Skip to content

Commit

Permalink
Error: Fix negative formatting of HRESULT
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed May 7, 2024
1 parent 339dc23 commit 1881139
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions common/Error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,13 @@ void Error::SetHResult(std::string_view prefix, long err)
static_cast<DWORD>(std::size(buf)), nullptr);
if (r > 0)
{
m_description =
fmt::format("{}HRESULT {:08X}: {}", prefix, err, StringUtil::WideStringToUTF8String(std::wstring_view(buf, r)));
m_description = fmt::format("{}HRESULT {:08X}: {}", prefix, static_cast<unsigned>(err),
StringUtil::WideStringToUTF8String(std::wstring_view(buf, r)));
}
else
{
m_description = fmt::format("{}HRESULT {:08X}: <Could not resolve system error ID>", prefix, err);
m_description = fmt::format("{}HRESULT {:08X}: <Could not resolve system error ID>", prefix,
static_cast<unsigned>(err));
}
}

Expand Down

0 comments on commit 1881139

Please sign in to comment.