Browse Source

Don't use `feof` to check for end-of-file in DroppedFile.

Fixes #1551

Apparently `feof` is only set when `fread(..., size, count, ...) < size * count` happends,
however we actually have code that automatically adjust amount of bytes to read
(and at "eof" it really happends to be 0) so fread is never able to set the EOF flag.
Miku AuahDark 4 years ago
parent
commit
7524677d4c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/filesystem/DroppedFile.cpp

+ 1 - 1
src/modules/filesystem/DroppedFile.cpp

@@ -165,7 +165,7 @@ bool DroppedFile::flush()
 
 bool DroppedFile::isEOF()
 {
-	return file == nullptr || feof(file) != 0;
+	return file == nullptr || tell() >= getSize();
 }
 
 int64 DroppedFile::tell()