mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-05 17:29:43 +08:00
Fix js_strtol
This commit is contained in:
committed by
Tor Andersson
parent
72e95a48e3
commit
f93d24539b
@@ -31,7 +31,7 @@ double js_strtol(const char *s, char **p, int base)
|
|||||||
double x;
|
double x;
|
||||||
int c;
|
int c;
|
||||||
if (base == 10)
|
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');
|
x = x * 10 + (c - '0');
|
||||||
else
|
else
|
||||||
for (x = 0, c = *s++; table[c] < base; c = *s++)
|
for (x = 0, c = *s++; table[c] < base; c = *s++)
|
||||||
|
|||||||
Reference in New Issue
Block a user