Printf does not return a truth value for failure.
authorkeie <none@none>
Mon, 21 Jan 1985 23:58:07 +0000 (23:58 +0000)
committerkeie <none@none>
Mon, 21 Jan 1985 23:58:07 +0000 (23:58 +0000)
These -incorrect- tests were replaced by calls to ferror.

lang/basic/lib/write.c

index 0796958..21a8858 100644 (file)
@@ -19,14 +19,17 @@ int i;
        if(i>0) 
                if( fputc(' ',_chanwr)==EOF) error(29);
        fprintf(_chanwr,"%d",i);
+       if( ferror(_chanwr) ) error(29);
 }
 _wrflt(f)
 double f;
 {
-       if( fprintf(_chanwr,"%f",f)== EOF) error(29);
+       fprintf(_chanwr,"%f",f);
+       if( ferror(_chanwr) ) error(29);
 }
 _wrstr(s)
 String *s;
 {
-        if( fprintf(_chanwr,"\"%s\"",s->strval)== EOF) error(29);
+       fprintf(_chanwr,"\"%s\"",s->strval);
+       if( ferror(_chanwr) ) error(29);
 }