]> Shamusworld >> Repos - rmac/blobdiff - direct.c
Fix for incbin not including the exact requested bytes if offset is non zero
[rmac] / 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");
                                        }