From 103ab16679a42cb1bfa4cc4e6316195ec2d139b6 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 18 Sep 2023 22:32:05 +0200 Subject: [PATCH] CB3DMeshFileLoader: fix string read primitive --- source/Irrlicht/CB3DMeshFileLoader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Irrlicht/CB3DMeshFileLoader.cpp b/source/Irrlicht/CB3DMeshFileLoader.cpp index 124c0f1d..4ac79fb2 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);