CB3DMeshFileLoader: fix string read primitive

This commit is contained in:
sfan5 2023-09-18 22:32:05 +02:00
parent 64688f4490
commit 103ab16679
1 changed files with 3 additions and 2 deletions

View File

@ -1034,10 +1034,11 @@ bool CB3DMeshFileLoader::readChunkBRUS()
void CB3DMeshFileLoader::readString(core::stringc& newstring)
{
newstring="";
while (B3DFile->getPos() <= B3DFile->getSize())
while (true)
{
c8 character;
B3DFile->read(&character, sizeof(character));
if (B3DFile->read(&character, sizeof(character)) == 0)
return; // eof
if (character==0)
return;
newstring.append(character);