summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2016-11-22 16:03:57 +0000
committermillert <millert@openbsd.org>2016-11-22 16:03:57 +0000
commit3be2660ceb77af7c660c64c84e87a405215792cb (patch)
tree77e96b40d0deae4694bf2d0154c268b478be9897 /usr.sbin/lpr
parentFix CPU info struct. (diff)
downloadwireguard-openbsd-3be2660ceb77af7c660c64c84e87a405215792cb.tar.xz
wireguard-openbsd-3be2660ceb77af7c660c64c84e87a405215792cb.zip
Fix printf of NULL for the FILTERERR case when the tempfile is empty
or missing. From Sebastien Marie.
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r--usr.sbin/lpr/lpd/printjob.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c
index d302bee2283..1e7b2471e97 100644
--- a/usr.sbin/lpr/lpd/printjob.c
+++ b/usr.sbin/lpr/lpd/printjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printjob.c,v 1.57 2016/01/29 21:23:11 tb Exp $ */
+/* $OpenBSD: printjob.c,v 1.58 2016/11/22 16:03:57 millert Exp $ */
/* $NetBSD: printjob.c,v 1.31 2002/01/21 14:42:30 wiz Exp $ */
/*
@@ -1161,6 +1161,7 @@ sendmail(char *user, int bombed)
cp = "NOACCT";
break;
case FILTERERR:
+ cp = "FILTERERR";
if (stat(tempfile, &stb) < 0 || stb.st_size == 0 ||
(fp = fopen(tempfile, "r")) == NULL) {
printf("\nhad some errors and may not have printed\n");
@@ -1170,7 +1171,6 @@ sendmail(char *user, int bombed)
while ((i = getc(fp)) != EOF)
putchar(i);
(void)fclose(fp);
- cp = "FILTERERR";
break;
case ACCESS:
printf("\nwas not printed because it was not linked to the original file\n");