From f811dbb57516b6f3a34637bd1c8c8299ceea20e4 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Wed, 9 Oct 2013 22:16:04 +1300 Subject: [PATCH] Fix accept() bug, which was using the wrong isRW for error conversion. Also fixed a debug issue where local_name is used uninitialised. --- Source/Core/Core/Src/IPC_HLE/WII_Socket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_Socket.cpp b/Source/Core/Core/Src/IPC_HLE/WII_Socket.cpp index 0caa2ed7e8..96a8df0915 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_Socket.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_Socket.cpp @@ -236,7 +236,7 @@ void WiiSocket::update(bool read, bool write, bool except) socklen_t addrlen = sizeof(sockaddr_in); 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); } @@ -433,6 +433,7 @@ void WiiSocket::update(bool read, bool write, bool except) flags &= SO_MSG_OOB; sockaddr_in local_name; + memset(&local_name, 0, sizeof(sockaddr_in)); if (has_destaddr) { WiiSockAddrIn* wii_name = (WiiSockAddrIn*)Memory::GetPointer(BufferIn2 + 0x0C);