]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
simplegrep: use correct sign in printf format
authorJustin Viiret <justin.viiret@intel.com>
Tue, 3 Nov 2015 05:21:56 +0000 (16:21 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 10 Nov 2015 03:36:38 +0000 (14:36 +1100)
examples/simplegrep.c

index 2fe6e6f34b2f342d64db67b4d3226ed9e4bd363c..9e392a8f41470be34f79fb49fbea83c7ea0a314c 100644 (file)
@@ -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;
     }