Skip to content

Commit e6b0875

Browse files
author
Mike Pall
committed
Fix string to number conversion.
Thanks to Lesley De Cruz.
1 parent 4fa51af commit e6b0875

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lj_strscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static StrScanFmt strscan_dec(const uint8_t *p, TValue *o,
199199
*xip++ = d + ((*p != '.' ? *p : *++p) & 15); p++;
200200
}
201201
/* Scan and realign trailing digit. */
202-
if (i) *xip++ = 10 * ((*p != '.' ? *p : *++p) & 15), ex10--, p++;
202+
if (i) *xip++ = 10 * ((*p != '.' ? *p : *++p) & 15), ex10--, dig++, p++;
203203

204204
/* Summarize rounding-effect of excess digits. */
205205
if (dig > STRSCAN_MAXDIG) {

0 commit comments

Comments
 (0)