aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppfiles.c
diff options
context:
space:
mode:
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 33801d6..1bd6c5a 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;