summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-12 12:42:03 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-12 12:42:03 +0000
commit9e330570c27da2e00126d46499be163cfe6ad862 (patch)
treeafa504bc2aa9cc6353b08a019e263d98bbd4b953
parenta2c7420efc15dc3c3e0e32f233ee52dfabad131a (diff)
downloadgcc-9e330570c27da2e00126d46499be163cfe6ad862.tar.gz
* cppfiles.c (read_include_file): Set buffer size properly when
file is shorter than expected. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47931 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cppfiles.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 833d2d268a1..c34e921cb87 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Dec 12 07:35:24 2001 Douglas B. Rupp <rupp@gnat.com>
+
+ * cppfiles.c (read_include_file): Set buffer size properly when
+ file is shorter than expected.
+
Wed Dec 12 08:35:33 2001 Nicola Pero <n.pero@mi.flashnet.it>
* objc/objc-act.c (encode_complete_bitfield): Fixed encoding
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 33801d610a6..1bd6c5a0891 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -413,8 +413,9 @@ read_include_file (pfile, inc)
if (!STAT_SIZE_TOO_BIG (inc->st))
cpp_warning
(pfile, "%s is shorter than expected", inc->name);
- buf = xrealloc (buf, offset);
- inc->st.st_size = offset;
+ size = offset;
+ buf = xrealloc (buf, size + 1);
+ inc->st.st_size = size;
break;
}
offset += count;