diff --git a/source/Irrlicht/CB3DMeshFileLoader.cpp b/source/Irrlicht/CB3DMeshFileLoader.cpp index 124c0f1..4ac79fb 100644 --- a/source/Irrlicht/CB3DMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DMeshFileLoader.cpp @@ -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);