diff options
author | tjr <tjr@FreeBSD.org> | 2004-07-09 05:15:46 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-07-09 05:15:46 +0000 |
commit | 3e5d71bd1a8c445e99b4335403253a679f3a2d07 (patch) | |
tree | fb02ef9c8a5252db84c7f5235dfcc2a1d36db7a7 /usr.bin | |
parent | f4c76ff4de3a4a1fc4c060c05168217f72049a3d (diff) | |
download | FreeBSD-src-3e5d71bd1a8c445e99b4335403253a679f3a2d07.zip FreeBSD-src-3e5d71bd1a8c445e99b4335403253a679f3a2d07.tar.gz |
Report input errors instead of ignoring them.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tr/tr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c index f3ce7ee..4932584 100644 --- a/usr.bin/tr/tr.c +++ b/usr.bin/tr/tr.c @@ -138,6 +138,8 @@ main(int argc, char **argv) lastch = ch; (void)putwchar(ch); } + if (ferror(stdin)) + err(1, NULL); exit(0); } @@ -154,6 +156,8 @@ main(int argc, char **argv) while ((ch = getwchar()) != WEOF) if (!cset_in(delete, ch)) (void)putwchar(ch); + if (ferror(stdin)) + err(1, NULL); exit(0); } @@ -169,6 +173,8 @@ main(int argc, char **argv) lastch = ch; (void)putwchar(ch); } + if (ferror(stdin)) + err(1, NULL); exit(0); } @@ -324,6 +330,8 @@ endloop: ch = cmap_lookup(map, ch); (void)putwchar(ch); } + if (ferror(stdin)) + err(1, NULL); exit (0); } |