Commit 472847ad authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

input cast to unsigned char for unqualified tolower(); close #342

parent f141ae42
...@@ -802,8 +802,9 @@ readint_float(codegen_scope *s, const char *p, int base) ...@@ -802,8 +802,9 @@ readint_float(codegen_scope *s, const char *p, int base)
mrb_float f = 0; mrb_float f = 0;
int n; int n;
while (p <= e) { while (p < e) {
char c = tolower(*p); char c = *p;
c = tolower((unsigned char)c);
for (n=0; n<base; n++) { for (n=0; n<base; n++) {
if (mrb_digitmap[n] == c) { if (mrb_digitmap[n] == c) {
f *= base; f *= base;
......
...@@ -3949,7 +3949,7 @@ parser_yylex(parser_state *p) ...@@ -3949,7 +3949,7 @@ parser_yylex(parser_state *p)
} }
if (!ISXDIGIT(c)) break; if (!ISXDIGIT(c)) break;
nondigit = 0; nondigit = 0;
tokadd(p, c); tokadd(p, tolower(c));
} while ((c = nextc(p)) != -1); } while ((c = nextc(p)) != -1);
} }
pushback(p, c); pushback(p, c);
......
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