dj(1): use the retvals of Io_read and Io_write
This commit is contained in:
parent
cc64561388
commit
4004a4a006
6
src/dj.c
6
src/dj.c
@ -263,8 +263,7 @@ int main(int argc, char *argv[]){
|
|||||||
return oserr(io[i].fn);
|
return oserr(io[i].fn);
|
||||||
|
|
||||||
do{ /* read */
|
do{ /* read */
|
||||||
Io_read(&io[0]);
|
if(Io_read(&io[0])->bufuse == 0 && !noerror)
|
||||||
if(!noerror && io[0].bufuse == 0)
|
|
||||||
Io_read(&io[0]); /* second chance */
|
Io_read(&io[0]); /* second chance */
|
||||||
if(io[0].bufuse == 0) /* that's all she wrote */
|
if(io[0].bufuse == 0) /* that's all she wrote */
|
||||||
break;
|
break;
|
||||||
@ -311,8 +310,7 @@ int main(int argc, char *argv[]){
|
|||||||
}
|
}
|
||||||
|
|
||||||
t = io[1].bufuse;
|
t = io[1].bufuse;
|
||||||
Io_write(&io[1]);
|
if(Io_write(&io[1])->bufuse == t && !noerror)
|
||||||
if(!noerror && io[1].bufuse == t)
|
|
||||||
Io_write(&io[1]); /* second chance */
|
Io_write(&io[1]); /* second chance */
|
||||||
if(t == io[1].bufuse){ /* no more love */
|
if(t == io[1].bufuse){ /* no more love */
|
||||||
count = 1;
|
count = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user