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))
putc(*p, stderr);
fprintf(stderr, " >>> ");
for (; p < q; p++)
for (; p < ep; p++)
if (isprint((uchar)*p))
putc(*p, stderr);
fprintf(stderr, " <<< ");

View file

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