mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-08 20:17:22 +08:00
* cppmacro.c (stringify_arg): Null terminate strings.
From-SVN: r40880
This commit is contained in:
parent
0b29309adf
commit
b044e9d5e9
@ -1,3 +1,7 @@
|
||||
2001-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* cppmacro.c (stringify_arg): Null terminate strings.
|
||||
|
||||
2001-03-27 Zack Weinberg <zackw@stanford.edu>
|
||||
|
||||
* config.gcc (m68hc11-*-*, m68hc12-*-*): Convert to new tm.h
|
||||
|
@ -296,7 +296,7 @@ stringify_arg (pfile, arg)
|
||||
if (escape_it)
|
||||
/* Worst case is each char is octal. */
|
||||
len *= 4;
|
||||
len++; /* Room for initial space. */
|
||||
len += 2; /* Room for initial space and final NUL. */
|
||||
|
||||
dest = &start[total_len];
|
||||
if (dest + len > POOL_LIMIT (pool))
|
||||
@ -334,7 +334,9 @@ stringify_arg (pfile, arg)
|
||||
total_len--;
|
||||
}
|
||||
|
||||
POOL_COMMIT (pool, total_len);
|
||||
/* Null terminate, and commit the memory. */
|
||||
start[total_len] = '\0';
|
||||
POOL_COMMIT (pool, total_len + 1);
|
||||
|
||||
arg->stringified = xnew (cpp_token);
|
||||
arg->stringified->flags = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user