firmware-utils/buffalo-enc: explicitly use signed char for checksum function
authorFelix Fietkau <nbd@openwrt.org>
Mon, 12 Oct 2015 13:11:20 +0000 (13:11 +0000)
committerFelix Fietkau <nbd@openwrt.org>
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>
SVN-Revision: 47186

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

index add3a7e0233adb01b4e3876dcc55d79e6a8cc456..b1d5ede0a287d270036d682cf45cee1444d80133 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;