]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix string to number conversion.
authorMike Pall <mike>
Sun, 22 Feb 2015 22:07:49 +0000 (23:07 +0100)
committerMike Pall <mike>
Sun, 22 Feb 2015 22:07:49 +0000 (23:07 +0100)
Thanks to Lesley De Cruz.

src/lj_strscan.c

index e2cf76f42a00a229b5a192bc88b78090210a738e..568f647d6a935bbac3d66b34a2a77b8cec153f5e 100644 (file)
@@ -199,7 +199,7 @@ static StrScanFmt strscan_dec(const uint8_t *p, TValue *o,
       *xip++ = d + ((*p != '.' ? *p : *++p) & 15); p++;
     }
     /* Scan and realign trailing digit. */
-    if (i) *xip++ = 10 * ((*p != '.' ? *p : *++p) & 15), ex10--, p++;
+    if (i) *xip++ = 10 * ((*p != '.' ? *p : *++p) & 15), ex10--, dig++, p++;
 
     /* Summarize rounding-effect of excess digits. */
     if (dig > STRSCAN_MAXDIG) {