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 | |
| parent | 0f37b7a24cb46792184dcc589fffc956ee2c858c (diff) | |
| download | ppe42-gcc-0913b893fb9b020222c2e189e4273c9e4b8326a7.tar.gz ppe42-gcc-0913b893fb9b020222c2e189e4273c9e4b8326a7.zip | |
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
| -rw-r--r-- | gcc/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/cppmacro.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 006f16d034b..1227fefd139 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2001-06-21 Neil Booth <neil@cat.daikokuya.demon.co.uk> + + * cppmacro.c (make_string_token): Null terminate. + 2001-06-21 DJ Delorie <dj@redhat.com> * config/alpha/alpha.h (struct machine_function): Remove. 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; } |

