1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

src: restore lseek() error check in file.cpp

This commit is contained in:
Markus F.X.J. Oberhumer 2022-12-20 11:51:31 +01:00
parent 1bed77e4d3
commit 1eb6a40fdd

View File

@ -135,7 +135,7 @@ upx_off_t FileBase::seek(upx_off_t off, int whence) {
}
// SEEK_CUR falls through to here
upx_off_t rv = ::lseek(_fd, off, whence);
if (0 == (1+ rv)) // lazy coding to check for "-1" failure of ::lseek
if (rv < 0)
throwIOException("seek error", errno);
return rv - _offset;
}