diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-04-12 22:51:10 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-04-12 22:51:10 +0200 |
commit | c17463bcae75a9f9b7108807745ec7bb2d472514 (patch) | |
tree | a089c8858bbc928e4cad61a5a21b867df56d4d9a /src/dynamic.cpp | |
parent | 4ded5ca9280d8538cb4aa8f478021476a5643e5c (diff) |
Filter out newlines from error messages on Windows
Diffstat (limited to 'src/dynamic.cpp')
-rw-r--r-- | src/dynamic.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dynamic.cpp b/src/dynamic.cpp index 1470dff0c..b17f13190 100644 --- a/src/dynamic.cpp +++ b/src/dynamic.cpp @@ -101,5 +101,9 @@ void DLLManager::RetrieveLastError() FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errmsg, 100, 0); SetLastError(ERROR_SUCCESS); err = errmsg; + + std::string::size_type p; + while ((p = err.find_last_of("\r\n")) != std::string::npos) + err.erase(p, 1); } #endif |