From 44affc758d3e77e8fa9afcbc58d789053ca415bd Mon Sep 17 00:00:00 2001 From: devinacker Date: Sat, 9 Apr 2016 21:21:42 -0400 Subject: [PATCH] use %l instead of %z --- exhal.c | 6 +++--- inhal.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/exhal.c b/exhal.c index 6720148..2e804ef 100644 --- a/exhal.c +++ b/exhal.c @@ -68,7 +68,7 @@ int main (int argc, char **argv) { outputsize = unpack_from_file(infile, fileoffset, unpacked); } else { fprintf(stderr, "Error: Unable to decompress %s because an invalid offset was specified\n" - " (must be between zero and 0x%X).\n", argv[1], ftell(infile)); + " (must be between zero and 0x%lX).\n", argv[1], ftell(infile)); exit(-1); } @@ -81,10 +81,10 @@ int main (int argc, char **argv) { exit(-1); } - printf("Uncompressed size: %zu bytes\n", outputsize); + printf("Uncompressed size: %lu bytes\n", (unsigned long)outputsize); } else { fprintf(stderr, "Error: Unable to decompress %s because the output would have been larger than\n" - " 64 kb. The input at 0x%X is likely not valid compressed data.\n", argv[1], fileoffset); + " 64 kb. The input at 0x%lX is likely not valid compressed data.\n", argv[1], (unsigned long)fileoffset); } fclose(infile); diff --git a/inhal.c b/inhal.c index 9c36de7..c4797fe 100644 --- a/inhal.c +++ b/inhal.c @@ -94,7 +94,7 @@ int main (int argc, char **argv) { fseek(infile, 0, SEEK_END); inputsize = ftell(infile); - printf("Uncompressed size: %zd bytes\n", inputsize); + printf("Uncompressed size: %lu bytes\n", (unsigned long)inputsize); if (inputsize > DATA_SIZE) { fprintf(stderr, "Error: File must be a maximum of 65,536 bytes!\n"); @@ -126,7 +126,7 @@ int main (int argc, char **argv) { exit(-1); } - printf("Compressed size: % zu bytes\n", outputsize); + printf("Compressed size: %lu bytes\n", (unsigned long)outputsize); printf("Compression ratio: %4.2f%%\n", 100 * (double)outputsize / inputsize); printf("Compression time: %4.3f seconds\n\n", (double)time / CLOCKS_PER_SEC);