Windows: Use 64 bit conversion for tonumber() with base.
Thanks to yEv3yKw. #911 #1523
This commit is contained in:
parent
634daf2453
commit
2a8e017ef1
@ -298,13 +298,13 @@ LJLIB_ASM(tonumber) LJLIB_REC(.)
|
|||||||
const char *p = strdata(lj_lib_checkstr(L, 1));
|
const char *p = strdata(lj_lib_checkstr(L, 1));
|
||||||
char *ep;
|
char *ep;
|
||||||
unsigned int neg = 0;
|
unsigned int neg = 0;
|
||||||
unsigned long ul;
|
unsigned long long ul;
|
||||||
if (base < 2 || base > 36)
|
if (base < 2 || base > 36)
|
||||||
lj_err_arg(L, 2, LJ_ERR_BASERNG);
|
lj_err_arg(L, 2, LJ_ERR_BASERNG);
|
||||||
while (lj_char_isspace((unsigned char)(*p))) p++;
|
while (lj_char_isspace((unsigned char)(*p))) p++;
|
||||||
if (*p == '-') { p++; neg = 1; } else if (*p == '+') { p++; }
|
if (*p == '-') { p++; neg = 1; } else if (*p == '+') { p++; }
|
||||||
if (lj_char_isalnum((unsigned char)(*p))) {
|
if (lj_char_isalnum((unsigned char)(*p))) {
|
||||||
ul = strtoul(p, &ep, base);
|
ul = strtoull(p, &ep, base);
|
||||||
if (p != ep) {
|
if (p != ep) {
|
||||||
while (lj_char_isspace((unsigned char)(*ep))) ep++;
|
while (lj_char_isspace((unsigned char)(*ep))) ep++;
|
||||||
if (*ep == '\0') {
|
if (*ep == '\0') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user