aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lauxlib.c b/lauxlib.c
index a36655f2..e4b12587 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -920,10 +920,9 @@ LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) {
920 else { 920 else {
921 switch (lua_type(L, idx)) { 921 switch (lua_type(L, idx)) {
922 case LUA_TNUMBER: { 922 case LUA_TNUMBER: {
923 if (lua_isinteger(L, idx)) 923 char buff[LUA_N2SBUFFSZ];
924 lua_pushfstring(L, "%I", (LUAI_UACINT)lua_tointeger(L, idx)); 924 lua_numbertostrbuff(L, idx, buff);
925 else 925 lua_pushstring(L, buff);
926 lua_pushfstring(L, "%f", (LUAI_UACNUMBER)lua_tonumber(L, idx));
927 break; 926 break;
928 } 927 }
929 case LUA_TSTRING: 928 case LUA_TSTRING: