summaryrefslogtreecommitdiffstats
path: root/usr.bin/cksum
diff options
context:
space:
mode:
authoralex <alex@FreeBSD.org>1997-12-29 00:09:06 +0000
committeralex <alex@FreeBSD.org>1997-12-29 00:09:06 +0000
commit005e82d0d48c18bf9c8f7dd68fbdddaecd02fa38 (patch)
treed6173536ac119a8f4ca284ec466429ed22238d6c /usr.bin/cksum
parent2d2c1486baa4d002f1ec27ce2fdbf344aa08d814 (diff)
downloadFreeBSD-src-005e82d0d48c18bf9c8f7dd68fbdddaecd02fa38.zip
FreeBSD-src-005e82d0d48c18bf9c8f7dd68fbdddaecd02fa38.tar.gz
-Wall cleanup.
Diffstat (limited to 'usr.bin/cksum')
-rw-r--r--usr.bin/cksum/crc32.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/cksum/crc32.c b/usr.bin/cksum/crc32.c
index ffeacc1..51aff76 100644
--- a/usr.bin/cksum/crc32.c
+++ b/usr.bin/cksum/crc32.c
@@ -86,9 +86,11 @@ unsigned long crctab[256] = {
#include <stdio.h>
#include <sys/types.h>
+#include <unistd.h>
u_long crc32_total = 0 ;
+int
crc32(fd, cval, clen)
register int fd;
u_long *cval, *clen;
@@ -96,11 +98,10 @@ crc32(fd, cval, clen)
u_long crc = ~0;
char buf[BUFSIZ], *p ;
int len, nr ;
- FILE *in;
len = 0 ;
crc32_total = ~crc32_total ;
- while (nr = read(fd, buf, sizeof(buf)))
+ while ((nr = read(fd, buf, sizeof(buf))))
for (len += nr, p = buf; nr--; ++p) {
CRC(crc, *p) ;
CRC(crc32_total, *p) ;
OpenPOWER on IntegriCloud