ref: cb47ac8b9750fb91036fbba2e515e4333fff7339
parent: 028e7af7d161550973faec64d839372171b8e9bf
author: daid <[email protected]>
date: Tue Mar 9 03:49:48 EST 2021
Change the start position check on INCBIN Currently INCBIN gives an error if your start position == file size. This means you cannot include an empty file. It also means the text of the error message is incorrect (as the start is not greater, but equal to the length of the file)
--- a/src/asm/section.c
+++ b/src/asm/section.c
@@ -774,7 +774,7 @@
if (fseek(f, 0, SEEK_END) != -1) {
fsize = ftell(f);
- if (startPos >= fsize) {
+ if (startPos > fsize) {
error("Specified start position is greater than length of file\n");
fclose(f);
return;
@@ -841,7 +841,7 @@
if (fseek(f, 0, SEEK_END) != -1) {
fsize = ftell(f);
- if (start_pos >= fsize) {
+ if (start_pos > fsize) {
error("Specified start position is greater than length of file\n");
return;
}