diff options
-rw-r--r-- | src/luasocket/inet.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/luasocket/inet.c b/src/luasocket/inet.c index ec73fea..fabbffc 100644 --- a/src/luasocket/inet.c +++ b/src/luasocket/inet.c @@ -248,7 +248,7 @@ int inet_meth_getpeername(lua_State *L, p_socket ps, int family) lua_pushstring(L, socket_strerror(errno)); return 2; } - err = getnameinfo((struct sockaddr *) &peer, peer_len, + err = getnameinfo((struct sockaddr *) &peer, peer_len, name, INET6_ADDRSTRLEN, port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV); if (err) { @@ -282,8 +282,8 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family) lua_pushstring(L, socket_strerror(errno)); return 2; } - err=getnameinfo((struct sockaddr *)&peer, peer_len, - name, INET6_ADDRSTRLEN, port, 6, NI_NUMERICHOST | NI_NUMERICSERV); + err=getnameinfo((struct sockaddr *)&peer, peer_len, + name, INET6_ADDRSTRLEN, port, 6, NI_NUMERICHOST | NI_NUMERICSERV); if (err) { lua_pushnil(L); lua_pushstring(L, gai_strerror(err)); @@ -433,14 +433,14 @@ const char *inet_tryconnect(p_socket ps, int *family, const char *address, \*-------------------------------------------------------------------------*/ const char *inet_tryaccept(p_socket server, int family, p_socket client, p_timeout tm) { - socklen_t len; - t_sockaddr_storage addr; + socklen_t len; + t_sockaddr_storage addr; switch (family) { case AF_INET6: len = sizeof(struct sockaddr_in6); break; case AF_INET: len = sizeof(struct sockaddr_in); break; default: len = sizeof(addr); break; } - return socket_strerror(socket_accept(server, client, (SA *) &addr, + return socket_strerror(socket_accept(server, client, (SA *) &addr, &len, tm)); } |