summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/lptest
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/lpr/lptest')
-rw-r--r--usr.sbin/lpr/lptest/lptest.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/lpr/lptest/lptest.c b/usr.sbin/lpr/lptest/lptest.c
index c73b796..3042963 100644
--- a/usr.sbin/lpr/lptest/lptest.c
+++ b/usr.sbin/lpr/lptest/lptest.c
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <stdio.h>
+#include <err.h>
/*
* lptest -- line printer test program (and other devices).
@@ -75,11 +76,13 @@ main(int argc, char **argv)
fc = ' ';
nc = fc;
for (j = 0; j < len; j++) {
- putchar(nc);
+ if (putchar(nc) == EOF)
+ err(1, "Write error");
if (++nc == 0177)
nc = ' ';
}
- putchar('\n');
+ if (putchar('\n') == EOF)
+ err(1, "Write error");
}
(void) fflush(stdout);
exit(0);
OpenPOWER on IntegriCloud