Whamcloud - gitweb
tests: fix shadow -Wall warnings in the crcsum test program
authorTheodore Ts'o <tytso@mit.edu>
Tue, 17 Aug 2021 22:01:39 +0000 (18:01 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 19 Aug 2021 02:39:25 +0000 (22:39 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
tests/progs/crcsum.c

index 9794e10..193bf0a 100644 (file)
@@ -57,11 +57,10 @@ int main(int argc, char **argv)
 
        while (!feof(f)) {
                unsigned char buf[4096];
+               int cnt = fread(buf, 1, sizeof(buf), f);
 
-               int c = fread(buf, 1, sizeof(buf), f);
-
-               if (c)
-                       crc = csum_func(crc, buf, c);
+               if (cnt)
+                       crc = csum_func(crc, buf, cnt);
        }
        printf("%u\n", crc);
        return 0;