From a4d9b7b11e61cd34d9c6e900118976ed94d61472 Mon Sep 17 00:00:00 2001 From: FRIGN Date: Sat, 1 Feb 2014 20:14:25 +0000 Subject: [PATCH] Use PRIu32 and avoid cast --- cksum.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cksum.c b/cksum.c index 25f7274..e762e85 100644 --- a/cksum.c +++ b/cksum.c @@ -1,5 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include +#include #include #include #include @@ -106,7 +107,7 @@ cksum(FILE *fp, const char *s) for(i = len; i > 0; i >>= 8) ck = (ck << 8) ^ crctab[(ck >> 24) ^ (i & 0xFF)]; - printf("%lu %lu", (unsigned long)~ck, (unsigned long)len); + printf("%"PRIu32" %lu", ~ck, (unsigned long)len); if(s != NULL) printf(" %s", s); putchar('\n');