Skip to content

Commit

Permalink
use %l instead of %z
Browse files Browse the repository at this point in the history
  • Loading branch information
devinacker committed Apr 10, 2016
1 parent a357670 commit 44affc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions exhal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions inhal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 44affc7

Please sign in to comment.