소스 검색

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 년 전
부모
커밋
7524677d4c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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()