diff options
author | Bruce Korb <bkorb@gnu.org> | 2001-02-06 22:19:50 +0000 |
---|---|---|
committer | Bruce Korb <korbb@gcc.gnu.org> | 2001-02-06 22:19:50 +0000 |
commit | ca21b4a51c8e1c6f6f36188dd82be0596ba1722f (patch) | |
tree | 61c3341761015a5904b857610bc777c9eb7649a4 /gcc/fixinc/fixlib.c | |
parent | 3c8465d07749a7f4ce6337d65f609bcef43ef890 (diff) | |
download | gcc-ca21b4a51c8e1c6f6f36188dd82be0596ba1722f.zip gcc-ca21b4a51c8e1c6f6f36188dd82be0596ba1722f.tar.gz gcc-ca21b4a51c8e1c6f6f36188dd82be0596ba1722f.tar.bz2 |
do not rely on load_file_data() to close file pointer
From-SVN: r39501
Diffstat (limited to 'gcc/fixinc/fixlib.c')
-rw-r--r-- | gcc/fixinc/fixlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fixinc/fixlib.c b/gcc/fixinc/fixlib.c index 7bf8cbc..647d2b3 100644 --- a/gcc/fixinc/fixlib.c +++ b/gcc/fixinc/fixlib.c @@ -39,6 +39,9 @@ load_file_data (fp) int space_left = -1; /* allow for terminating NUL */ size_t space_used = 0; + if (fp == (FILE*)NULL) + return pz_data; + do { size_t size_read; @@ -62,7 +65,6 @@ load_file_data (fp) fprintf (stderr, "error %d (%s) reading input\n", err, xstrerror (err)); free ((void *) pz_data); - fclose (fp); return (char *) NULL; } } @@ -73,7 +75,6 @@ load_file_data (fp) pz_data = xrealloc ((void*)pz_data, space_used+1 ); pz_data[ space_used ] = NUL; - fclose (fp); return pz_data; } |