summaryrefslogtreecommitdiffstats
path: root/gcc/cppfiles.c
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 /gcc/cppfiles.c
parenta2c7420efc15dc3c3e0e32f233ee52dfabad131a (diff)
downloadppe42-gcc-9e330570c27da2e00126d46499be163cfe6ad862.tar.gz
ppe42-gcc-9e330570c27da2e00126d46499be163cfe6ad862.zip
* 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
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r--gcc/cppfiles.c5
1 files changed, 3 insertions, 2 deletions
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;
OpenPOWER on IntegriCloud