WSAGetLastError: fix return value

This commit is contained in:
Sepalani 2015-10-05 23:00:04 +02:00
parent 5d1f78da3b
commit 8efd5d1a74
2 changed files with 4 additions and 3 deletions

View File

@ -81,7 +81,8 @@ static s32 TranslateErrorCode(s32 native_error, bool isRW)
}
}
s32 WiiSockMan::GetNetErrorCode(s32 ret, const std::string& caller, bool isRW)
// Don't use string! (see https://github.com/dolphin-emu/dolphin/pull/3143)
s32 WiiSockMan::GetNetErrorCode(s32 ret, const char* caller, bool isRW)
{
#ifdef _WIN32
s32 errorCode = WSAGetLastError();
@ -96,7 +97,7 @@ s32 WiiSockMan::GetNetErrorCode(s32 ret, const std::string& caller, bool isRW)
}
INFO_LOG(WII_IPC_NET, "%s failed with error %d: %s, ret= %d",
caller.c_str(), errorCode, DecodeError(errorCode), ret);
caller, errorCode, DecodeError(errorCode), ret);
s32 ReturnValue = TranslateErrorCode(errorCode, isRW);
WiiSockMan::GetInstance().SetLastNetError(ReturnValue);

View File

@ -201,7 +201,7 @@ public:
class WiiSockMan : public ::NonCopyable
{
public:
static s32 GetNetErrorCode(s32 ret, const std::string& caller, bool isRW);
static s32 GetNetErrorCode(s32 ret, const char* caller, bool isRW);
static char* DecodeError(s32 ErrorCode);
static WiiSockMan& GetInstance()