X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsocketengine.cpp;h=4a9a2ef10539e1b0c50d5c77fbc02e6aa6b49227;hb=68211809ee3111bdc9609fbd46dc3c875fbb5ea6;hp=8af598b069ed6184565810688b416f2823f88810;hpb=6e0b904d342461cd2ac2a3cd0cf2a43d864d2b00;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 8af598b06..4a9a2ef10 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -265,7 +265,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 }