From 1881139b0ab6a1a9e1af8b6d39c0d97e99c3cc97 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 7 May 2024 01:44:02 +1000 Subject: [PATCH] Error: Fix negative formatting of HRESULT --- common/Error.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/Error.cpp b/common/Error.cpp index 1d7b54a153..9877e4bc73 100644 --- a/common/Error.cpp +++ b/common/Error.cpp @@ -141,12 +141,13 @@ void Error::SetHResult(std::string_view prefix, long err) static_cast(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(err), + StringUtil::WideStringToUTF8String(std::wstring_view(buf, r))); } else { - m_description = fmt::format("{}HRESULT {:08X}: ", prefix, err); + m_description = fmt::format("{}HRESULT {:08X}: ", prefix, + static_cast(err)); } }