From f1a92a07efbc0dd17758500b2c91ca8ddbdeabca Mon Sep 17 00:00:00 2001 From: ame Date: Thu, 13 Feb 2025 01:27:10 -0600 Subject: small changes --- src/lua.c | 2 +- src/net.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lua.c b/src/lua.c index f98a4a4..d41ee91 100644 --- a/src/lua.c +++ b/src/lua.c @@ -58,7 +58,7 @@ void luaI_deepcopy(lua_State* src, lua_State* dest, enum deep_copy_flags flags){ switch(type = lua_type(src, -1)){ case LUA_TNUMBER: n = lua_tonumber(src, -1); - if(n == (int)n) lua_pushinteger(dest, (int)n); + if(n == (uint64_t)n) lua_pushinteger(dest, lua_tonumber(src, -1)); else lua_pushnumber(dest, n); break; case LUA_TSTRING:; diff --git a/src/net.c b/src/net.c index 4163394..334acc8 100644 --- a/src/net.c +++ b/src/net.c @@ -289,6 +289,7 @@ int i_ws_close(lua_State* L){ lua_pushstring(L, "_"); lua_gettable(L, 1); struct wss_data* data = lua_touserdata(L, -1); + if(data != NULL){ str_free(data->buffer); @@ -302,7 +303,7 @@ int i_ws_close(lua_State* L){ free(data); } - luaI_tsetlud(L, 1, "_", NULL); + data = NULL; return 0; } -- cgit v1.2.3