Skip to content

Commit

Permalink
RMG-Core: correct zlib_filefunc_read() in Rom.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Feb 29, 2024
1 parent db9bd5d commit e80e202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/RMG-Core/Rom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static uLong zlib_filefunc_read(voidpf opaque, voidpf stream, void* buf, uLong s
{
std::ifstream* fileStream = (std::ifstream*)stream;
fileStream->read((char*)buf, size);
return fileStream->bad() ? 0 : fileStream->gcount();
return fileStream->fail() ? fileStream->gcount() : size;
}

static ZPOS64_T zlib_filefunc_tell(voidpf opaque, voidpf stream)
Expand Down

0 comments on commit e80e202

Please sign in to comment.