[*] Update consistency in 895ef058

This commit is contained in:
Reece Wilson 2024-03-11 17:13:27 +00:00
parent ac1501c357
commit f401c6f750

View File

@ -337,13 +337,21 @@ namespace Aurora::IO::FS
return false;
}
bool ok {};
ok = pStream->Write(AuMemoryViewStreamRead { bom });
ok &= pStream->Write(AuMemoryViewStreamRead { str });
bool bOk {};
bOk = pStream->Write(AuMemoryViewStreamRead { bom });
if (auto uLength = str.length())
{
bOk &= pStream->Write(AuMemoryViewStreamRead { str, uLength });
bOk &= uLength == uLength;
}
else
{
bOk = true;
}
pStream->Flush();
pStream->WriteEoS();
return ok;
return bOk;
}
AUKN_SYM bool WriteNewString(const AuString &path, const AuString &str)
@ -373,10 +381,15 @@ namespace Aurora::IO::FS
}
bOk = pStream->Write(AuMemoryViewStreamRead { bom });
bOk &= pStream->Write(AuMemoryViewStreamRead { str, uLength });
bOk &= uLength == str.length();
if (auto uLength = str.length())
{
bOk &= pStream->Write(AuMemoryViewStreamRead { str, uLength });
bOk &= uLength == uLength;
}
else
{
bOk = true;
}
pStream->WriteEoS();
pStream->Flush();
}
@ -409,11 +422,17 @@ namespace Aurora::IO::FS
return false;
}
bOk = pStream->Write(AuMemoryViewStreamRead { blob, uLength });
if (blob.length)
{
bOk = pStream->Write(AuMemoryViewStreamRead { blob, uLength });
bOk &= uLength == blob.length;
}
else
{
bOk = true;
}
pStream->WriteEoS();
pStream->Flush();
bOk &= uLength == blob.length;
}
RuntimeWaitForSecondaryTick();