Unverified Commit ec41262e authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4374 from dearblue/hexdump

Fix hexdigits convertion
parents 4d8ff2fb dac0f3f5
......@@ -5712,11 +5712,12 @@ parser_yylex(parser_state *p)
if (!identchar(c)) {
char buf[36];
const char s[] = "Invalid char in expression: 0x";
const char hexdigits[] = "0123456789ABCDEF";
strcpy(buf, s);
buf[sizeof(s)] = (c & 0xff00) >> 8;
buf[sizeof(s)+1] = (c & 0xff);
buf[sizeof(s)+2] = 0;
buf[sizeof(s)-1] = hexdigits[(c & 0xf0) >> 4];
buf[sizeof(s)] = hexdigits[(c & 0x0f)];
buf[sizeof(s)+1] = 0;
yyerror(p, buf);
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