summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2016-11-22 16:03:58 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2016-11-22 16:03:58 +0000
commit3845fac762e7575ef4baa76c5e2f541859654c66 (patch)
tree04f544c1dad1df99f63168efd429e929cf3c311a
parentf1161fe56cfd00b4fc45d00f9d7b6e36c8907cfe (diff)
Fix printf of NULL for the FILTERERR case when the tempfile is empty
or missing. From Sebastien Marie.
-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");