From bef62aeb503422d70ccb04fd65d26e6cb9bc2cb1 Mon Sep 17 00:00:00 2001 From: georgeto <9250103+georgeto@users.noreply.github.com> Date: Wed, 8 Nov 2023 12:29:06 +0100 Subject: [PATCH] fix(inet): Return port as number in getsockname (#392) --- src/inet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inet.c b/src/inet.c index 138c9ab..afef5f4 100755 --- a/src/inet.c +++ b/src/inet.c @@ -290,7 +290,7 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family) return 2; } lua_pushstring(L, name); - lua_pushstring(L, port); + lua_pushinteger(L, (int) strtol(port, (char **) NULL, 10)); switch (family) { case AF_INET: lua_pushliteral(L, "inet"); break; case AF_INET6: lua_pushliteral(L, "inet6"); break;