From e5c384bba77a0294f2ff8dc6c2bc03a1cebbbcdc Mon Sep 17 00:00:00 2001 From: ggn Date: Mon, 11 Oct 2021 19:51:47 +0300 Subject: [PATCH] Fix for incbin not including the exact requested bytes if offset is non zero --- direct.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/direct.c b/direct.c index e3685d1..d82f15c 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"); } -- 2.32.0.windows.2