Mercurial > hg > toybox
changeset 128:0a90a5fbc1bf
Add xputs() to detect EOF on writes.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 18 Jun 2007 00:14:03 -0400 |
parents | 343117774a9f |
children | 0dfead29c893 |
files | lib/lib.c lib/lib.h |
diffstat | 2 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/lib.c Mon Jun 18 00:12:43 2007 -0400 +++ b/lib/lib.c Mon Jun 18 00:14:03 2007 -0400 @@ -155,6 +155,11 @@ 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");