Fix for incbin not including the exact requested bytes if offset is non zero

This commit is contained in:
ggn 2021-10-11 19:51:47 +03:00 committed by Shamus Hammons
parent dc18dfea58
commit 7170b3e33a
1 changed files with 1 additions and 2 deletions

View File

@ -645,8 +645,7 @@ allright:
}
lseek(fd, pos, SEEK_SET);
size -= pos;
if ((int64_t)size < 0)
if ((int64_t)(size - pos) < 0)
{
return error("requested incbin size out of range");
}