From 3845fac762e7575ef4baa76c5e2f541859654c66 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 22 Nov 2016 16:03:58 +0000 Subject: Fix printf of NULL for the FILTERERR case when the tempfile is empty or missing. From Sebastien Marie. --- usr.sbin/lpr/lpd/printjob.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin/lpr') 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"); -- cgit v1.2.3