diff options
author | gad <gad@FreeBSD.org> | 2002-04-07 08:12:39 +0000 |
---|---|---|
committer | gad <gad@FreeBSD.org> | 2002-04-07 08:12:39 +0000 |
commit | 09a50a4aaea92ccce93e637d202f81754764d8fa (patch) | |
tree | c7e260522fb721b1b3861eedd3f4e47a412e0031 /usr.sbin/lpr | |
parent | 1a0c92cc050bf47b070eb7dda00be930f40f1519 (diff) | |
download | FreeBSD-src-09a50a4aaea92ccce93e637d202f81754764d8fa.zip FreeBSD-src-09a50a4aaea92ccce93e637d202f81754764d8fa.tar.gz |
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
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r-- | usr.sbin/lpr/lpd/printjob.c | 13 |
1 files changed, 6 insertions, 7 deletions
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); |