diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-21 20:56:07 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-21 20:56:07 +0000 |
commit | 0913b893fb9b020222c2e189e4273c9e4b8326a7 (patch) | |
tree | 1cf6d50388fe0644d4243dfacccbf8edffe31393 /gcc/cppmacro.c | |
parent | 0f37b7a24cb46792184dcc589fffc956ee2c858c (diff) | |
download | gcc-0913b893fb9b020222c2e189e4273c9e4b8326a7.tar.gz |
PR preprocessor/3260
* cppmacro.c (make_string_token): Null terminate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43492 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r-- | gcc/cppmacro.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 40c61762ed8..d8ef424a96b 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -105,11 +105,12 @@ make_string_token (pool, token, text, len) const U_CHAR *text; unsigned int len; { - U_CHAR *buf = _cpp_pool_alloc (pool, len * 4); + U_CHAR *buf = _cpp_pool_alloc (pool, len * 4 + 1); token->type = CPP_STRING; token->val.str.text = buf; token->val.str.len = quote_string (buf, text, len) - buf; + token->val.str.text[token->val.str.len] = '\0'; token->flags = 0; } |