Printf does not return a truth value for failure.

These -incorrect- tests were replaced by calls to ferror.
This commit is contained in:
keie 1985-01-21 23:58:07 +00:00
parent 09000449a4
commit 7556180ab3

View 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);
}