diff options
author | Juan Manuel Guerrero <juan.guerrero@gmx.de> | 2002-04-03 17:32:28 +0000 |
---|---|---|
committer | Juan Manuel Guerrero <juan.guerrero@gmx.de> | 2002-04-03 17:32:28 +0000 |
commit | 1d8fe3622f989ba84052db38c8a509e68c6b5e3b (patch) | |
tree | c4fdb2c0cfd0673325c24a161c4a4be456f57d4b | |
parent | 9906fc0beef52ad31d150d3a26403a454d9a05de (diff) | |
download | bison-1d8fe3622f989ba84052db38c8a509e68c6b5e3b.tar.gz |
Zero terminate all token_obstack and token_buffer strings.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/lex.c | 8 |
2 files changed, 13 insertions, 0 deletions
@@ -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. @@ -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; } |