cppfiles.c (read_include_file): Set buffer size properly when file is shorter than expected.

* cppfiles.c (read_include_file): Set buffer size properly when
	file is shorter than expected.

From-SVN: r47931
This commit is contained in:
Douglas B Rupp 2001-12-12 07:42:03 -05:00 committed by Richard Kenner
parent a9785c70dc
commit cdb290580c
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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;