aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/grap/print.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2007-10-29 10:34:43 -0400
committerRuss Cox <rsc@swtch.com>2007-10-29 10:34:43 -0400
commitc5a183de108e5685305734d5cf984b58bb0d614a (patch)
treecff5b040fb14ff22f0a26237e18fb7bfc59a83f2 /src/cmd/grap/print.c
parent151b86a03703255445a2165f714e914032f6c4a8 (diff)
downloadplan9port-c5a183de108e5685305734d5cf984b58bb0d614a.tar.gz
plan9port-c5a183de108e5685305734d5cf984b58bb0d614a.tar.bz2
plan9port-c5a183de108e5685305734d5cf984b58bb0d614a.zip
grap: fclose, error context bug fixes (Doug Gwyn)
Diffstat (limited to 'src/cmd/grap/print.c')
-rw-r--r--src/cmd/grap/print.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/grap/print.c b/src/cmd/grap/print.c
index dbecb5df..a7497e44 100644
--- a/src/cmd/grap/print.c
+++ b/src/cmd/grap/print.c
@@ -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;
}