From 9e330570c27da2e00126d46499be163cfe6ad862 Mon Sep 17 00:00:00 2001 From: kenner Date: Wed, 12 Dec 2001 12:42:03 +0000 Subject: * 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 --- gcc/cppfiles.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/cppfiles.c') 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; -- cgit v1.2.3