diff options
author | Rob Landley <rob@landley.net> | 2007-06-18 00:14:03 -0400 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-06-18 00:14:03 -0400 |
commit | 5084feadff6503852bf11019baa3e943bbcd4305 (patch) | |
tree | f1289d120ff066e54c014fa3cf92de4b028e58fb /lib/lib.c | |
parent | 7aa9d8fbf1d56a5b41fb007c0bf2089a6e3dae98 (diff) | |
download | toybox-5084feadff6503852bf11019baa3e943bbcd4305.tar.gz |
Add xputs() to detect EOF on writes.
Diffstat (limited to 'lib/lib.c')
-rw-r--r-- | lib/lib.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -155,6 +155,11 @@ void xprintf(char *format, ...) if (ferror(stdout)) perror_exit("write"); } +void xputs(char *s) +{ + if (EOF == puts(s)) perror_exit("write"); +} + void xputc(char c) { if (EOF == fputc(c, stdout)) perror_exit("write"); |