firmware-utils/buffalo-enc: explicitly use signed char for checksum function
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 12 Oct 2015 13:11:20 +0000 (13:11 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 12 Oct 2015 13:11:20 +0000 (13:11 +0000)
ARM defaults to unsigned char and that breaks the calculation, as it
relies on sign extension

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47186 3c298f89-4303-0410-b956-a3cf2f4a3e73

tools/firmware-utils/src/buffalo-lib.c

index add3a7e..b1d5ede 100644 (file)
@@ -179,7 +179,7 @@ int bcrypt_buf(unsigned char seed, unsigned char *key, unsigned char *src,
 
 uint32_t buffalo_csum(uint32_t csum, void *buf, unsigned long len)
 {
-       char *p = buf;
+       signed char *p = buf;
 
        while (len--) {
                int i;