Core/String: Fix (Un)Serialize not checking string read/write
Former-commit-id: 8d6f907fcaf20374b713851a102dfc4b0003a39d
This commit is contained in:
parent
35b27bbe67
commit
a47e5633d4
|
|
@ -4214,8 +4214,7 @@ namespace Nz
|
|||
if (!Serialize<UInt32>(context, string.GetSize()))
|
||||
return false;
|
||||
|
||||
context.stream->Write(string.GetConstBuffer(), string.GetSize());
|
||||
return true;
|
||||
return context.stream->Write(string.GetConstBuffer(), string.GetSize()) == string.GetSize();
|
||||
}
|
||||
|
||||
bool Unserialize(UnserializationContext& context, String* string)
|
||||
|
|
@ -4225,8 +4224,7 @@ namespace Nz
|
|||
return false;
|
||||
|
||||
string->Resize(size);
|
||||
context.stream->Read(string->GetBuffer(), size);
|
||||
return true;
|
||||
return context.stream->Read(string->GetBuffer(), size) == size;
|
||||
}
|
||||
|
||||
const unsigned int String::npos(std::numeric_limits<unsigned int>::max());
|
||||
|
|
|
|||
Loading…
Reference in New Issue