summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Manuel Guerrero <juan.guerrero@gmx.de>2002-04-03 17:32:28 +0000
committerJuan Manuel Guerrero <juan.guerrero@gmx.de>2002-04-03 17:32:28 +0000
commit1d8fe3622f989ba84052db38c8a509e68c6b5e3b (patch)
treec4fdb2c0cfd0673325c24a161c4a4be456f57d4b
parent9906fc0beef52ad31d150d3a26403a454d9a05de (diff)
downloadbison-1d8fe3622f989ba84052db38c8a509e68c6b5e3b.tar.gz
Zero terminate all token_obstack and token_buffer strings.
-rw-r--r--ChangeLog5
-rw-r--r--src/lex.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9959211d..9e341ff8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-03 Guerrero, Juan Manuel <st001906@hrz1.hrz.tu-darmstadt.de>
+
+ * src/lex.c (parse_percent_token): Zero terminate all token_obstack
+ and token_buffer strings.
+
2002-03-25 Akim Demaille <akim@epita.fr>
Version 1.35.
diff --git a/src/lex.c b/src/lex.c
index 1d2424e2..a3fff440 100644
--- a/src/lex.c
+++ b/src/lex.c
@@ -596,10 +596,12 @@ parse_percent_token (void)
switch (c)
{
case '%':
+ obstack_1grow (&token_obstack, '\0');
token_buffer = obstack_finish (&token_obstack);
return tok_two_percents;
case '{':
+ obstack_1grow (&token_obstack, '\0');
token_buffer = obstack_finish (&token_obstack);
return tok_percent_left_curly;
@@ -607,28 +609,34 @@ parse_percent_token (void)
very ancient Yacc versions. The paper of Johnson mentions
them (as ancient :). */
case '<':
+ obstack_1grow (&token_obstack, '\0');
token_buffer = obstack_finish (&token_obstack);
return tok_left;
case '>':
+ obstack_1grow (&token_obstack, '\0');
token_buffer = obstack_finish (&token_obstack);
return tok_right;
case '2':
+ obstack_1grow (&token_obstack, '\0');
token_buffer = obstack_finish (&token_obstack);
return tok_nonassoc;
case '0':
+ obstack_1grow (&token_obstack, '\0');
token_buffer = obstack_finish (&token_obstack);
return tok_token;
case '=':
+ obstack_1grow (&token_obstack, '\0');
token_buffer = obstack_finish (&token_obstack);
return tok_prec;
}
if (!isalpha (c))
{
+ obstack_1grow (&token_obstack, '\0');
token_buffer = obstack_finish (&token_obstack);
return tok_illegal;
}