From 09a50a4aaea92ccce93e637d202f81754764d8fa Mon Sep 17 00:00:00 2001 From: gad Date: Sun, 7 Apr 2002 08:12:39 +0000 Subject: A variable had been unnecessarily assigned a bogus value because gcc was "confused" about it being unassigned. In fact, gcc was right. Fix the real problem by setting that variable before break-ing out of a select statement so gcc is happy, and then remove the unnecessary assignment. Reported by: a user wondering why lpd syslog-ed about "compiler confusion" MFC after: 12 days --- usr.sbin/lpr/lpd/printjob.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'usr.sbin/lpr/lpd') diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index 103286e..26b9b39 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -1407,24 +1407,24 @@ sendmail(struct printer *pp, char *userid, int bombed) printf("Your printer job "); if (*jobname) printf("(%s) ", jobname); - - cp = "XXX compiler confusion"; /* XXX shut GCC up */ + switch (bombed) { case OK: - printf("\ncompleted successfully\n"); cp = "OK"; + printf("\ncompleted successfully\n"); break; default: case FATALERR: - printf("\ncould not be printed\n"); cp = "FATALERR"; + printf("\ncould not be printed\n"); break; case NOACCT: + cp = "NOACCT"; printf("\ncould not be printed without an account on %s\n", local_host); - cp = "NOACCT"; break; case FILTERERR: + cp = "FILTERERR"; if (stat(tempstderr, &stb) < 0 || stb.st_size == 0 || (fp = fopen(tempstderr, "r")) == NULL) { printf("\nhad some errors and may not have printed\n"); @@ -1434,11 +1434,10 @@ sendmail(struct printer *pp, char *userid, 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"); cp = "ACCESS"; + printf("\nwas not printed because it was not linked to the original file\n"); } fflush(stdout); (void) close(1); -- cgit v1.1