From: ggn Date: Mon, 11 Oct 2021 16:51:47 +0000 (+0300) Subject: Fix for incbin not including the exact requested bytes if offset is non zero X-Git-Tag: v2.1.13~1 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=7170b3e33aa62681bf59d6b8bcc05c09018396a1 Fix for incbin not including the exact requested bytes if offset is non zero --- diff --git a/direct.c b/direct.c index e3685d1..809bb79 100644 --- a/direct.c +++ b/direct.c @@ -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"); }