Make string to number conversions fail on NUL char.

Contributed by Igor Munkin.
This commit is contained in:
Mike Pall
2020-02-13 17:39:51 +01:00
parent d85d6b3c1b
commit 0ad60ccbc3
4 changed files with 12 additions and 7 deletions

View File

@@ -22,7 +22,8 @@ typedef enum {
STRSCAN_INT, STRSCAN_U32, STRSCAN_I64, STRSCAN_U64,
} StrScanFmt;
LJ_FUNC StrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt);
LJ_FUNC StrScanFmt lj_strscan_scan(const uint8_t *p, MSize len, TValue *o,
uint32_t opt);
LJ_FUNC int LJ_FASTCALL lj_strscan_num(GCstr *str, TValue *o);
#if LJ_DUALNUM
LJ_FUNC int LJ_FASTCALL lj_strscan_number(GCstr *str, TValue *o);