diff --git a/src/codegen.c b/src/codegen.c index 2654fcbe3..8aef2a328 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -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