ref: f93d24539bc1dc3e8f82ebc6c4e90c3a82adb430
parent: 72e95a48e36c064a081291f5c645e8fe7e9e52d3
author: Connor Nelson <Connor@ConnorNelson.com>
date: Fri Mar 26 14:40:40 EDT 2021
Fix js_strtol
--- a/jsvalue.c
+++ b/jsvalue.c
@@ -31,7 +31,7 @@
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++)