diff options
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.149 2016/05/02 14:03:19 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.150 2016/09/01 16:14:56 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -619,8 +619,10 @@ static int g_write (lua_State *L, FILE *f, int arg) { | |||
619 | if (lua_type(L, arg) == LUA_TNUMBER) { | 619 | if (lua_type(L, arg) == LUA_TNUMBER) { |
620 | /* optimization: could be done exactly as for strings */ | 620 | /* optimization: could be done exactly as for strings */ |
621 | int len = lua_isinteger(L, arg) | 621 | int len = lua_isinteger(L, arg) |
622 | ? fprintf(f, LUA_INTEGER_FMT, lua_tointeger(L, arg)) | 622 | ? fprintf(f, LUA_INTEGER_FMT, |
623 | : fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)); | 623 | (LUAI_UACINT)lua_tointeger(L, arg)) |
624 | : fprintf(f, LUA_NUMBER_FMT, | ||
625 | (LUAI_UACNUMBER)lua_tonumber(L, arg)); | ||
624 | status = status && (len > 0); | 626 | status = status && (len > 0); |
625 | } | 627 | } |
626 | else { | 628 | else { |