Fix js_strtol

This commit is contained in:
Connor Nelson
2021-03-26 18:40:40 -07:00
committed by Tor Andersson
parent 72e95a48e3
commit f93d24539b

View File

@@ -31,7 +31,7 @@ double js_strtol(const char *s, char **p, int base)
double x;
int c;
if (base == 10)
for (x = 0, c = *s++; c - '0' < 10; c = *s++)
for (x = 0, c = *s++; (0 <= c - '0') && (c - '0' < 10); c = *s++)
x = x * 10 + (c - '0');
else
for (x = 0, c = *s++; table[c] < base; c = *s++)