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; }