Commit dac0f3f5 authored by dearblue's avatar dearblue

Fix string index for appending

`sizeof(string-literal)` is included `'\0'` character
parent c2fa935f
...@@ -5715,9 +5715,9 @@ parser_yylex(parser_state *p) ...@@ -5715,9 +5715,9 @@ parser_yylex(parser_state *p)
const char hexdigits[] = "0123456789ABCDEF"; const char hexdigits[] = "0123456789ABCDEF";
strcpy(buf, s); strcpy(buf, s);
buf[sizeof(s)] = hexdigits[(c & 0xf0) >> 4]; buf[sizeof(s)-1] = hexdigits[(c & 0xf0) >> 4];
buf[sizeof(s)+1] = hexdigits[(c & 0x0f)]; buf[sizeof(s)] = hexdigits[(c & 0x0f)];
buf[sizeof(s)+2] = 0; buf[sizeof(s)+1] = 0;
yyerror(p, buf); yyerror(p, buf);
goto retry; goto retry;
} }
......
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