On windows it fails there. Windows needs a flag O_BINARY when using binary files with open(). Otherwise newline sequences accidentally found in the binary stream are converted by mistake so this check that should be redundant actually fails. In the file maybe there is 0x10,0x13 and it reads 0x13 only, so it appears to read less bytes.
https://github.com/wuxx/icesugar/blob/6424e0d8f8a48fe0bd77059bbc0fa9bf72767708/tools/src/icesprog.c#L659
On windows it fails there. Windows needs a flag O_BINARY when using binary files with
open()
. Otherwise newline sequences accidentally found in the binary stream are converted by mistake so this check that should be redundant actually fails. In the file maybe there is 0x10,0x13 and it reads 0x13 only, so it appears to read less bytes.