diff --git a/src/utils/fileUtilities.c b/src/utils/fileUtilities.c index 2c9a917..b02417c 100644 --- a/src/utils/fileUtilities.c +++ b/src/utils/fileUtilities.c @@ -9,11 +9,11 @@ //Reads the given amount of bytes from the currently open file into the given buffer. void readBytesIntoBuffer(uint8_t* buffer, long numBytes) { - const size_t result = fread(buffer, 1, numBytes, file.filePointer); + const unsigned long result = fread(buffer, 1, numBytes, file.filePointer); file.offset += result; if (result != numBytes) { - fprintf(stderr, "Could not read %lu bytes from file: %s\n", numBytes, strerror(errno)); + fprintf(stderr, "Wanted to read %lu bytes from file but only read %lu bytes: %s\n", numBytes, result, strerror(errno)); exit(1); } }