We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9088c7e commit e6f30cbCopy full SHA for e6f30cb
system/win_utils.cpp
@@ -19,7 +19,11 @@ std::string ErrorStringFromErrorCode(const DWORD errCode) noexcept
19
20
assert_and_return_message_r(nCharsWritten > 0, "FormatMessageA failed with error code " + std::to_string(::GetLastError()), {});
21
22
- return std::string(msgBuf, nCharsWritten);
+ std::string str(msgBuf, nCharsWritten);
23
+ if (str.ends_with("\r\n"))
24
+ str[str.size() - 2] = '\0'; // Remove trailing CRLF
25
+
26
+ return str;
27
}
28
29
std::string ErrorStringFromLastError() noexcept
0 commit comments