libs/nixio: Fix recvfrom() return values for unnamed unix sockets, patch by capnbry@gmail.com (#274)

This commit is contained in:
Jo-Philipp Wich 2011-07-17 09:04:43 +00:00
parent 9fdb4acec0
commit 518dc0fef9

View file

@ -179,7 +179,7 @@ static int nixio_sock__recvfrom(lua_State *L, int from) {
}
}
#ifndef __WINNT__
else if (sock->domain == AF_UNIX) {
else if (sock->domain == AF_UNIX && alen > sizeof(sa_family_t)) {
lua_pushstring(L, addr_un.sun_path);
return 2;
}