ref: 7bac090c8d2fa73f053aebb4c0d0680ba42a2246
parent: abd59674ccfd3d4285e475e667458d7c2dc65b74
author: Tor Andersson <tor@ccxvii.net>
date: Fri Feb 28 12:13:09 EST 2014
Tweak js_strtod.
--- a/jsvalue.c
+++ b/jsvalue.c
@@ -115,13 +115,13 @@
char *end;
double n;
const char *e = s;
- while (*e == '+' || *e == '-') ++e;
+ if (*e == '+' || *e == '-') ++e;
while (*e >= '0' && *e <= '9') ++e;
if (*e == '.') ++e;
while (*e >= '0' && *e <= '9') ++e;
if (*e == 'e' || *e == 'E') {
++e;
- while (*e == '+' || *e == '-') ++e;
+ if (*e == '+' || *e == '-') ++e;
while (*e >= '0' && *e <= '9') ++e;
}
n = strtod(s, &end);