From: Neil Booth Date: Thu, 21 Jun 2001 20:56:07 +0000 (+0000) Subject: re PR preprocessor/3260 (#include __FILE__ broken) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a6e865f8b89fc3f2aec05a3a1c0e5e23b669f289;p=gcc.git re PR preprocessor/3260 (#include __FILE__ broken) PR preprocessor/3260 * cppmacro.c (make_string_token): Null terminate. From-SVN: r43492 --- 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 + + * cppmacro.c (make_string_token): Null terminate. + 2001-06-21 DJ Delorie * 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; }