...
This noncompliant code example calls putsfputs()
and fails to check whether a write error occurs:
Code Block | ||||
---|---|---|---|---|
| ||||
putsFILE* f = /* output file stream */ /* ... */ fputs("foo", f); |
However, putsfputs()
can fail and return EOF
.
...
Code Block | ||||
---|---|---|---|---|
| ||||
FILE* f = /* output file stream */ /* ... */ if (putsfputs("foo", f) == EOF) { /* Handle error */ } |
...