diff options
author | Li Jin <dragon-fly@qq.com> | 2021-01-05 16:48:53 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2021-01-05 16:48:53 +0800 |
commit | 71b9532659abb531bd1597d88451426dcc895824 (patch) | |
tree | c9b50856b37f759c9a31e1a6e761e77b51996fa6 /src/lua/lobject.c | |
parent | e3a31f9945053d8e8d9e4ef3d2e4c9abe563cff2 (diff) | |
download | yuescript-71b9532659abb531bd1597d88451426dcc895824.tar.gz yuescript-71b9532659abb531bd1597d88451426dcc895824.tar.bz2 yuescript-71b9532659abb531bd1597d88451426dcc895824.zip |
update Lua.
Diffstat (limited to 'src/lua/lobject.c')
-rw-r--r-- | src/lua/lobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lua/lobject.c b/src/lua/lobject.c index f8ea917..0e504be 100644 --- a/src/lua/lobject.c +++ b/src/lua/lobject.c | |||
@@ -258,7 +258,7 @@ static const char *l_str2d (const char *s, lua_Number *result) { | |||
258 | if (endptr == NULL) { /* failed? may be a different locale */ | 258 | if (endptr == NULL) { /* failed? may be a different locale */ |
259 | char buff[L_MAXLENNUM + 1]; | 259 | char buff[L_MAXLENNUM + 1]; |
260 | const char *pdot = strchr(s, '.'); | 260 | const char *pdot = strchr(s, '.'); |
261 | if (strlen(s) > L_MAXLENNUM || pdot == NULL) | 261 | if (pdot == NULL || strlen(s) > L_MAXLENNUM) |
262 | return NULL; /* string too long or no dot; fail */ | 262 | return NULL; /* string too long or no dot; fail */ |
263 | strcpy(buff, s); /* copy string to buffer */ | 263 | strcpy(buff, s); /* copy string to buffer */ |
264 | buff[pdot - s] = lua_getlocaledecpoint(); /* correct decimal point */ | 264 | buff[pdot - s] = lua_getlocaledecpoint(); /* correct decimal point */ |