From 4004a4a0068f173059ed59c5ac6aba10ec0c6ce6 Mon Sep 17 00:00:00 2001 From: DTB Date: Thu, 4 Jul 2024 18:41:20 -0600 Subject: [PATCH] dj(1): use the retvals of Io_read and Io_write --- src/dj.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/dj.c b/src/dj.c index 5a095ed..fa3d46a 100644 --- a/src/dj.c +++ b/src/dj.c @@ -263,8 +263,7 @@ int main(int argc, char *argv[]){ return oserr(io[i].fn); do{ /* read */ - Io_read(&io[0]); - if(!noerror && io[0].bufuse == 0) + if(Io_read(&io[0])->bufuse == 0 && !noerror) Io_read(&io[0]); /* second chance */ if(io[0].bufuse == 0) /* that's all she wrote */ break; @@ -311,8 +310,7 @@ int main(int argc, char *argv[]){ } t = io[1].bufuse; - Io_write(&io[1]); - if(!noerror && io[1].bufuse == t) + if(Io_write(&io[1])->bufuse == t && !noerror) Io_write(&io[1]); /* second chance */ if(t == io[1].bufuse){ /* no more love */ count = 1;