mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
input cast to unsigned char for unqualified tolower(); close #342
This commit is contained in:
+3
-2
@@ -802,8 +802,9 @@ readint_float(codegen_scope *s, const char *p, int base)
|
||||
mrb_float f = 0;
|
||||
int n;
|
||||
|
||||
while (p <= e) {
|
||||
char c = tolower(*p);
|
||||
while (p < e) {
|
||||
char c = *p;
|
||||
c = tolower((unsigned char)c);
|
||||
for (n=0; n<base; n++) {
|
||||
if (mrb_digitmap[n] == c) {
|
||||
f *= base;
|
||||
|
||||
+1
-1
@@ -3949,7 +3949,7 @@ parser_yylex(parser_state *p)
|
||||
}
|
||||
if (!ISXDIGIT(c)) break;
|
||||
nondigit = 0;
|
||||
tokadd(p, c);
|
||||
tokadd(p, tolower(c));
|
||||
} while ((c = nextc(p)) != -1);
|
||||
}
|
||||
pushback(p, c);
|
||||
|
||||
Reference in New Issue
Block a user