diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2022-05-17 11:47:01 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2023-07-09 17:20:40 +0200 |
| commit | d13f6bb870cdda71257f665367be8ef9fca86255 (patch) | |
| tree | 52e214718478f1e52856572f5aa1a2ac58537f9f /src/shared/windows_error.cpp | |
| parent | 86bb01ba9eac879d3685c439ac9da0028bc4bc80 (diff) | |
Apply clang-format.
Diffstat (limited to 'src/shared/windows_error.cpp')
| -rw-r--r-- | src/shared/windows_error.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/shared/windows_error.cpp b/src/shared/windows_error.cpp index 49fb9bc7..f0add1da 100644 --- a/src/shared/windows_error.cpp +++ b/src/shared/windows_error.cpp @@ -20,7 +20,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "windows_error.h" #include <sstream> -namespace MOShared { +namespace MOShared +{ std::string windows_error::constructMessage(const std::string& input, int inErrorCode) { @@ -33,17 +34,19 @@ std::string windows_error::constructMessage(const std::string& input, int inErro // TODO: the message is not english? if (FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - nullptr, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&buffer, 0, nullptr) == 0) { + nullptr, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&buffer, 0, nullptr) == 0) { finalMessage << " (errorcode " << errorCode << ")"; } else { LPSTR lastChar = buffer + strlen(buffer) - 2; - *lastChar = '\0'; + *lastChar = '\0'; finalMessage << " (" << buffer << " [" << errorCode << "])"; - LocalFree(buffer); // allocated by FormatMessage + LocalFree(buffer); // allocated by FormatMessage } - ::SetLastError(errorCode); // restore error code because FormatMessage might have modified it + ::SetLastError( + errorCode); // restore error code because FormatMessage might have modified it return finalMessage.str(); } -} // namespace MOShared +} // namespace MOShared |
