[hackers] [sbase] Use uint32_t instead of unsigned int in cksum(1) || sin

From: <git_AT_suckless.org>
Date: Fri, 31 Jan 2014 14:53:46 +0100

commit 04a32251e413495b9aa1a5a727a17e76ce0d8b13
Author: sin <sin_AT_2f30.org>
Date: Fri Jan 31 13:51:10 2014 +0000

    Use uint32_t instead of unsigned int in cksum(1)

diff --git a/cksum.c b/cksum.c
index 8347a88..25f7274 100644
--- a/cksum.c
+++ b/cksum.c
_AT_@ -1,4 +1,5 @@
 /* See LICENSE file for copyright and license details. */
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
_AT_@ -90,7 +91,7 @@ void
 cksum(FILE *fp, const char *s)
 {
         unsigned char buf[BUFSIZ];
- unsigned int ck = 0;
+ uint32_t ck = 0;
         size_t len = 0;
         size_t i, n;
 
_AT_@ -105,7 +106,7 @@ cksum(FILE *fp, const char *s)
         for(i = len; i > 0; i >>= 8)
                 ck = (ck << 8) ^ crctab[(ck >> 24) ^ (i & 0xFF)];
 
- printf("%u %lu", ~ck, (unsigned long)len);
+ printf("%lu %lu", (unsigned long)~ck, (unsigned long)len);
         if(s != NULL)
                 printf(" %s", s);
         putchar('
');
Received on Fri Jan 31 2014 - 14:53:46 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 31 2014 - 15:00:20 CET