From 51c80200399966fa9c1f0ad6b629071a2d1ec636 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Tue, 3 Nov 2015 16:21:56 +1100 Subject: [PATCH] simplegrep: use correct sign in printf format --- examples/simplegrep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/simplegrep.c b/examples/simplegrep.c index 2fe6e6f3..9e392a8f 100644 --- a/examples/simplegrep.c +++ b/examples/simplegrep.c @@ -109,7 +109,7 @@ static char *readInputData(const char *inputFN, unsigned int *length) { * limit the size of our buffer appropriately. */ if ((unsigned long)dataLen > UINT_MAX) { dataLen = UINT_MAX; - printf("WARNING: clipping data to %lu bytes\n", dataLen); + printf("WARNING: clipping data to %ld bytes\n", dataLen); } else if (dataLen == 0) { fprintf(stderr, "ERROR: input file \"%s\" is empty\n", inputFN); fclose(f); @@ -118,7 +118,7 @@ static char *readInputData(const char *inputFN, unsigned int *length) { char *inputData = malloc(dataLen); if (!inputData) { - fprintf(stderr, "ERROR: unable to malloc %lu bytes\n", dataLen); + fprintf(stderr, "ERROR: unable to malloc %ld bytes\n", dataLen); fclose(f); return NULL; }