grap: fclose, error context bug fixes (Doug Gwyn)

This commit is contained in:
Russ Cox 2007-10-29 10:34:43 -04:00
parent 151b86a037
commit c5a183de10
2 changed files with 4 additions and 3 deletions

View file

@ -460,7 +460,7 @@ void eprint(void) /* try to print context around error */
if (isprint((uchar)*p)) if (isprint((uchar)*p))
putc(*p, stderr); putc(*p, stderr);
fprintf(stderr, " >>> "); fprintf(stderr, " >>> ");
for (; p < q; p++) for (; p < ep; p++)
if (isprint((uchar)*p)) if (isprint((uchar)*p))
putc(*p, stderr); putc(*p, stderr);
fprintf(stderr, " <<< "); fprintf(stderr, " <<< ");

View file

@ -23,7 +23,8 @@ void print(void) /* arrange final output */
int c; int c;
double dx, dy, xfac, yfac; double dx, dy, xfac, yfac;
if (tfd != NULL) { if (tfd != stdout) {
if (tfd)
fclose(tfd); /* end the temp file */ fclose(tfd); /* end the temp file */
tfd = stdout; tfd = stdout;
} }