simplegrep: use correct sign in printf format

This commit is contained in:
Justin Viiret 2015-11-03 16:21:56 +11:00 committed by Matthew Barr
parent ed4a3cdcf1
commit 51c8020039

View File

@ -109,7 +109,7 @@ static char *readInputData(const char *inputFN, unsigned int *length) {
* limit the size of our buffer appropriately. */ * limit the size of our buffer appropriately. */
if ((unsigned long)dataLen > UINT_MAX) { if ((unsigned long)dataLen > UINT_MAX) {
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) { } else if (dataLen == 0) {
fprintf(stderr, "ERROR: input file \"%s\" is empty\n", inputFN); fprintf(stderr, "ERROR: input file \"%s\" is empty\n", inputFN);
fclose(f); fclose(f);
@ -118,7 +118,7 @@ static char *readInputData(const char *inputFN, unsigned int *length) {
char *inputData = malloc(dataLen); char *inputData = malloc(dataLen);
if (!inputData) { if (!inputData) {
fprintf(stderr, "ERROR: unable to malloc %lu bytes\n", dataLen); fprintf(stderr, "ERROR: unable to malloc %ld bytes\n", dataLen);
fclose(f); fclose(f);
return NULL; return NULL;
} }