Closed ewancg closed 2 years ago
To clarify, my implementation(s) will make this cutoff regardless of whether the included file has been shortened because of my char array handling. Either way, the difference is also reflected in filesize of the executable (I've compared the included content in the executable as well, that also gets cut off).
Edit: Nevermind. I'm an idiot. Have a good day
I am trying to make a resource system where given files are archived into a tarball, which is linked into the executable (where incbin comes into play). On paper this is not a problem, but it seems that with certain filetypes incbin is not including the entirety of the file. Example:
C version, to ensure it's not a C++ thing;
test.tar
is 1536 bytes.test2.tar
is 8 bytes.A hex editor tells me that the first null character in test.tar is on the ninth byte (the cutoff of test2.tar).
This happens with a PNG file, where the cutoff happens at its first null byte.
I'm not entirely sure if this is user error on my part or incbin not knowing when to stop including file. It's pretty rare to find a file with no null bytes in it, maybe it is misinterpreting the null character as the end of the file.
This happens both with gcc/g++ 11.1.0 and clang/clang++ 12.0.1