fix PIFile::readAll(force = true)

This commit is contained in:
2025-08-15 18:32:21 +03:00
parent f2464ed76b
commit 27f37c9cc1

View File

@@ -256,8 +256,11 @@ PIByteArray PIFile::readAll(bool forceRead) {
llong cp = pos();
if (forceRead) {
seekToBegin();
while (!isEnd())
a.push_back(readChar());
for (;;) {
uchar byte = static_cast<uchar>(fgetc(PRIVATE->fd));
if (feof(PRIVATE->fd) || ferror(PRIVATE->fd)) break;
a.push_back(byte);
}
seek(cp);
return a;
}