aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorNeil Booth <neil@cat.daikokuya.demon.co.uk>2001-06-21 20:56:07 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-06-21 20:56:07 +0000
commita6e865f8b89fc3f2aec05a3a1c0e5e23b669f289 (patch)
tree1cf6d50388fe0644d4243dfacccbf8edffe31393 /gcc/cppmacro.c
parentb91055dde92be2336dac176609cab4c9ccd29124 (diff)
downloadgcc-a6e865f8b89fc3f2aec05a3a1c0e5e23b669f289.zip
gcc-a6e865f8b89fc3f2aec05a3a1c0e5e23b669f289.tar.gz
gcc-a6e865f8b89fc3f2aec05a3a1c0e5e23b669f289.tar.bz2
re PR preprocessor/3260 (#include __FILE__ broken)
PR preprocessor/3260 * cppmacro.c (make_string_token): Null terminate. From-SVN: r43492
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;
}