From 71894a9c4a9636517777895d71da1e30f9905a1f Mon Sep 17 00:00:00 2001 From: C-3PO Date: Mon, 22 Jul 2019 20:55:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20error=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/fileUtilities.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } }