Silence C26451
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
0f412d5c38
commit
f0699d7f47
@ -277,7 +277,7 @@ static int vsprintf(_Inout_ std::basic_string<char, _Traits, _Ax> &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<size_t>(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<wchar_t, _Traits, _Ax> &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<size_t>(count) + 1, format, arg) != count)
|
||||
throw std::runtime_error("failed to format string");
|
||||
return count;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user