Commit cdb29058 by Douglas B Rupp Committed by Richard Kenner

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
parent a9785c70
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> Wed Dec 12 08:35:33 2001 Nicola Pero <n.pero@mi.flashnet.it>
* objc/objc-act.c (encode_complete_bitfield): Fixed encoding * objc/objc-act.c (encode_complete_bitfield): Fixed encoding
......
...@@ -413,8 +413,9 @@ read_include_file (pfile, inc) ...@@ -413,8 +413,9 @@ read_include_file (pfile, inc)
if (!STAT_SIZE_TOO_BIG (inc->st)) if (!STAT_SIZE_TOO_BIG (inc->st))
cpp_warning cpp_warning
(pfile, "%s is shorter than expected", inc->name); (pfile, "%s is shorter than expected", inc->name);
buf = xrealloc (buf, offset); size = offset;
inc->st.st_size = offset; buf = xrealloc (buf, size + 1);
inc->st.st_size = size;
break; break;
} }
offset += count; offset += count;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment