summaryrefslogtreecommitdiff
path: root/src/socketengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r--src/socketengine.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp
index c6c520efc..1c91ccdea 100644
--- a/src/socketengine.cpp
+++ b/src/socketengine.cpp
@@ -291,7 +291,13 @@ std::string SocketEngine::LastError()
DWORD dwErrorCode = WSAGetLastError();
if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)szErrorString, _countof(szErrorString), NULL) == 0)
sprintf_s(szErrorString, _countof(szErrorString), "Error code: %u", dwErrorCode);
- return szErrorString;
+
+ std::string::size_type p;
+ std::string ret = szErrorString;
+ while ((p = ret.find_last_of("\r\n")) != std::string::npos)
+ ret.erase(p, 1);
+
+ return ret;
#endif
}