Core/Algorithm: Use SafeCast to serialize string size
This commit is contained in:
parent
33374ed0c0
commit
aad271febe
|
|
@ -106,7 +106,7 @@ namespace Nz
|
|||
*/
|
||||
bool Serialize(SerializationContext& context, const std::string& value, TypeTag<std::string>)
|
||||
{
|
||||
if (!Serialize(context, UInt32(value.size()), TypeTag<UInt32>()))
|
||||
if (!Serialize(context, SafeCast<UInt32>(value.size()), TypeTag<UInt32>()))
|
||||
return false;
|
||||
|
||||
return context.stream->Write(value.data(), value.size()) == value.size();
|
||||
|
|
|
|||
Loading…
Reference in New Issue