]> git.saurik.com Git - apple/file_cmds.git/blobdiff - cksum/sum1.c
file_cmds-321.100.10.0.1.tar.gz
[apple/file_cmds.git] / cksum / sum1.c
index f3c05ce02ef99bc2817776096f963ab9a1782515..fa016ce2bc68ffe5ace7044f1f0b58ba73dca313 100644 (file)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD: src/usr.bin/cksum/sum1.c,v 1.8 2003/03/13 23:32:28 robert Ex
 int
 csum1(int fd, uint32_t *cval, off_t *clen)
 {
-       int nr;
+       ssize_t nr;
        u_int lcrc;
        off_t total;
        u_char *p;
@@ -60,7 +60,8 @@ csum1(int fd, uint32_t *cval, off_t *clen)
         * 16-bit checksum, rotating right before each addition;
         * overflow is discarded.
         */
-       lcrc = total = 0;
+       lcrc = 0;
+       total = 0;
        while ((nr = read(fd, buf, sizeof(buf))) > 0)
                for (total += nr, p = buf; nr--; ++p) {
                        if (lcrc & 1)