]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fsck.cramfs: fix compiler warning [-Wpointer-arith]
authorKarel Zak <kzak@redhat.com>
Wed, 29 Aug 2012 18:30:11 +0000 (20:30 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 4 Sep 2012 14:49:28 +0000 (16:49 +0200)
disk-utils/fsck.cramfs.c: In function ‘test_crc’:
disk-utils/fsck.cramfs.c:231:32: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
disk-utils/fsck.cramfs.c:233:24: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]

Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/fsck.cramfs.c

index 04f970f6a903bb880ca601ef3528a82007484156..b39d2310b59511d73e3e31debc0b98bb6cf1625a 100644 (file)
@@ -228,9 +228,9 @@ static void test_crc(int start)
                }
        }
        if (buf != MAP_FAILED) {
-               ((struct cramfs_super *)(buf + start))->fsid.crc =
+               ((struct cramfs_super *)((unsigned char *) buf + start))->fsid.crc =
                    crc32(0L, Z_NULL, 0);
-               crc = crc32(crc, buf + start, super.size - start);
+               crc = crc32(crc, (unsigned char *) buf + start, super.size - start);
                munmap(buf, super.size);
        } else {
                int retval;