Fix accept() bug, which was using the wrong isRW for error conversion.

Also fixed a debug issue where local_name is used uninitialised.
This commit is contained in:
Matthew Parlane 2013-10-09 22:16:04 +13:00
parent a317391e3d
commit f811dbb575

View File

@ -236,7 +236,7 @@ void WiiSocket::update(bool read, bool write, bool except)
socklen_t addrlen = sizeof(sockaddr_in); socklen_t addrlen = sizeof(sockaddr_in);
int ret = (s32)accept(fd, (sockaddr*)&local_name, &addrlen); int ret = (s32)accept(fd, (sockaddr*)&local_name, &addrlen);
ReturnValue = WiiSockMan::getNetErrorCode(ret, "SO_ACCEPT", false); ReturnValue = WiiSockMan::getNetErrorCode(ret, "SO_ACCEPT", true);
WiiSockMan::Convert(local_name, *wii_name, addrlen); WiiSockMan::Convert(local_name, *wii_name, addrlen);
} }
@ -433,6 +433,7 @@ void WiiSocket::update(bool read, bool write, bool except)
flags &= SO_MSG_OOB; flags &= SO_MSG_OOB;
sockaddr_in local_name; sockaddr_in local_name;
memset(&local_name, 0, sizeof(sockaddr_in));
if (has_destaddr) if (has_destaddr)
{ {
WiiSockAddrIn* wii_name = (WiiSockAddrIn*)Memory::GetPointer(BufferIn2 + 0x0C); WiiSockAddrIn* wii_name = (WiiSockAddrIn*)Memory::GetPointer(BufferIn2 + 0x0C);