Commit a6e865f8 by Neil Booth Committed by Neil Booth

re PR preprocessor/3260 (#include __FILE__ broken)

	PR preprocessor/3260
	* cppmacro.c (make_string_token): Null terminate.

From-SVN: r43492
parent b91055dd
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> 2001-06-21 DJ Delorie <dj@redhat.com>
* config/alpha/alpha.h (struct machine_function): Remove. * config/alpha/alpha.h (struct machine_function): Remove.
......
...@@ -105,11 +105,12 @@ make_string_token (pool, token, text, len) ...@@ -105,11 +105,12 @@ make_string_token (pool, token, text, len)
const U_CHAR *text; const U_CHAR *text;
unsigned int len; 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->type = CPP_STRING;
token->val.str.text = buf; token->val.str.text = buf;
token->val.str.len = quote_string (buf, text, len) - buf; token->val.str.len = quote_string (buf, text, len) - buf;
token->val.str.text[token->val.str.len] = '\0';
token->flags = 0; token->flags = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment