summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2015-10-03 14:59:20 -0700
committershuffle2 <godisgovernment@gmail.com>2015-10-03 14:59:20 -0700
commitb4be34bc68fcdce6903a2b14f7ecd5e211a33a6c (patch)
tree4f79b8ba75350fd4a728251c4f8dd134f6d1b76b /Source
parent5464e698fca03c8712a180d620dc114f5170760c (diff)
parentf33fae574f11aae12eab8162644d9946f5f04161 (diff)
Merge pull request #3124 from dolphin-emu/shuffle2-patch-1
Fix WiiSockMan::DecodeError
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/IPC_HLE/WII_Socket.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/Core/Core/IPC_HLE/WII_Socket.cpp b/Source/Core/Core/IPC_HLE/WII_Socket.cpp
index af621089be..aea7bfc001 100644
--- a/Source/Core/Core/IPC_HLE/WII_Socket.cpp
+++ b/Source/Core/Core/IPC_HLE/WII_Socket.cpp
@@ -24,13 +24,14 @@
char* WiiSockMan::DecodeError(s32 ErrorCode)
{
#ifdef _WIN32
+ // NOT THREAD SAFE
static char Message[1024];
- // If this program was multi-threaded, we'd want to use FORMAT_MESSAGE_ALLOCATE_BUFFER
- // instead of a static buffer here.
- // (And of course, free the buffer when we were done with it)
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
- FORMAT_MESSAGE_MAX_WIDTH_MASK, nullptr, ErrorCode,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)Message, 1024, nullptr);
+
+ FormatMessageA(
+ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK,
+ nullptr, ErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), Message,
+ sizeof(Message), nullptr);
+
return Message;
#else
return strerror(ErrorCode);