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
This commit is contained in:
Garance A Drosehn 2002-04-07 08:12:39 +00:00
parent 6710feea89
commit 50cf7393cb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94040

View File

@ -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);