aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r--gcc/cppmacro.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index 40c6176..d8ef424 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;
}