From f0699d7f47ea9409cc8f4f452d0f3326ccb9ec18 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 28 Mar 2025 10:13:00 +0100 Subject: [PATCH] Silence C26451 Signed-off-by: Simon Rozman --- include/WinStd/Common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/WinStd/Common.h b/include/WinStd/Common.h index d94f174a..08202d57 100644 --- a/include/WinStd/Common.h +++ b/include/WinStd/Common.h @@ -277,7 +277,7 @@ static int vsprintf(_Inout_ std::basic_string &str, _In_z_ _ } size_t offset = str.size(); str.resize(offset + count); - if (_vsnprintf(&str[offset], count + 1, format, arg) != count) + if (_vsnprintf(&str[offset], static_cast(count) + 1, format, arg) != count) throw std::runtime_error("failed to format string"); return count; } @@ -316,7 +316,7 @@ static int vsprintf(_Inout_ std::basic_string &str, _In_z } size_t offset = str.size(); str.resize(offset + count); - if (_vsnwprintf(&str[offset], count + 1, format, arg) != count) + if (_vsnwprintf(&str[offset], static_cast(count) + 1, format, arg) != count) throw std::runtime_error("failed to format string"); return count; }