]> Shamusworld >> Repos - rmac/commitdiff
Fix for incbin not including the exact requested bytes if offset is non zero
authorggn <ggn@atari.org>
Mon, 11 Oct 2021 16:51:47 +0000 (19:51 +0300)
committerShamus Hammons <jlhamm@acm.org>
Sat, 30 Oct 2021 15:23:26 +0000 (10:23 -0500)
direct.c

index e3685d1c8eef7c245370338c30347b215c6f4994..809bb79090460d4632a7c397e5de0061819af491 100644 (file)
--- 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");
                                        }