From: Vsevolod Stakhov Date: Tue, 23 Jun 2015 13:20:38 +0000 (+0100) Subject: Avoid non-portable lua integers. X-Git-Tag: 0.9.7~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=de0386172e99411b73f5cb509e298e3b70840e46;p=rspamd.git Avoid non-portable lua integers. --- diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index 938c0fa62..3e7ba80e2 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -1392,7 +1392,8 @@ lua_radix_get_key (lua_State * L) if (radix) { if (lua_type (L, 2) == LUA_TNUMBER) { - key_num = htonl (luaL_checkint (L, 2)); + key_num = luaL_checknumber (L, 2); + key_num = htonl (key_num); } else if (lua_type (L, 2) == LUA_TUSERDATA) { ud = luaL_checkudata (L, 2, "rspamd{ip}"); diff --git a/src/lua/lua_upstream.c b/src/lua/lua_upstream.c index 31ced8103..0b2739903 100644 --- a/src/lua/lua_upstream.c +++ b/src/lua/lua_upstream.c @@ -184,7 +184,7 @@ lua_upstream_list_create (lua_State *L) def = luaL_checkstring (L, 1); if (def) { if (lua_gettop (L) >= 2) { - default_port = luaL_checkinteger (L, 2); + default_port = luaL_checknumber (L, 2); } tokens = g_strsplit_set (def, ",;", 0);