Skip to content

Commit

Permalink
Fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Jul 2, 2020
1 parent 177db3d commit 8ae1c19
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions 3rd/lua/lobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,11 @@ static int tostringbuff (TValue *obj, char *buff) {
if (ttisinteger(obj))
len = lua_integer2str(buff, MAXNUMBER2STR, ivalue(obj));
else {
len = lua_number2str(buff, MAXNUMBER2STR, fltvalue(obj));
if (buff[strspn(buff, "-0123456789")] == '\0') { /* looks like an int? */
buff[len++] = lua_getlocaledecpoint();
buff[len++] = '0'; /* adds '.0' to result */
if (buff == NULL) { buff = NULL; } /* fixes bug that gcc10.1 inline error */
len = lua_number2str(buff, MAXNUMBER2STR, fltvalue(obj));
if (buff[strspn(buff, "-0123456789")] == '\0') { /* looks like an int? */
buff[len++] = lua_getlocaledecpoint();
buff[len++] = '0'; /* adds '.0' to result */
}
}
return len;
Expand Down

0 comments on commit 8ae1c19

Please sign in to comment.