|
Lines 180-185
Link Here
|
| 180 |
exit(2); |
180 |
exit(2); |
| 181 |
} |
181 |
} |
| 182 |
|
182 |
|
|
|
183 |
if (acctfile == NULL) { |
| 184 |
printf("pac: acct.file of printer %s didn't set in printcap\n", |
| 185 |
printer); |
| 186 |
exit(1); |
| 187 |
} |
| 183 |
if ((acct = fopen(acctfile, "r")) == NULL) { |
188 |
if ((acct = fopen(acctfile, "r")) == NULL) { |
| 184 |
perror(acctfile); |
189 |
perror(acctfile); |
| 185 |
exit(1); |
190 |
exit(1); |
|
Lines 453-462
Link Here
|
| 453 |
acctfile = pp->acct_file; |
458 |
acctfile = pp->acct_file; |
| 454 |
if (!pflag && pp->price100) |
459 |
if (!pflag && pp->price100) |
| 455 |
price = pp->price100/10000.0; |
460 |
price = pp->price100/10000.0; |
| 456 |
sumfile = (char *) calloc(sizeof(char), strlen(acctfile)+5); |
461 |
if (acctfile) { |
| 457 |
if (sumfile == NULL) |
462 |
sumfile = (char *) calloc(sizeof(char), strlen(acctfile)+5); |
| 458 |
errx(1, "calloc failed"); |
463 |
if (sumfile == NULL) |
| 459 |
strcpy(sumfile, acctfile); |
464 |
errx(1, "calloc failed"); |
| 460 |
strcat(sumfile, "_sum"); |
465 |
strcpy(sumfile, acctfile); |
|
|
466 |
strcat(sumfile, "_sum"); |
| 467 |
} |
| 461 |
return(1); |
468 |
return(1); |
| 462 |
} |
469 |
} |