Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/usr.bin/cksum Pull up revision 1.14 (requested by klein...



details:   https://anonhg.NetBSD.org/src/rev/3f66c786c1eb
branches:  netbsd-1-6
changeset: 531038:3f66c786c1eb
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Dec 21 08:13:35 2003 +0000

description:
Pull up revision 1.14 (requested by kleink in ticket #1580):
Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).

diffstat:

 usr.bin/cksum/crc.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r 70626f19c927 -r 3f66c786c1eb usr.bin/cksum/crc.c
--- a/usr.bin/cksum/crc.c       Sun Dec 21 08:13:30 2003 +0000
+++ b/usr.bin/cksum/crc.c       Sun Dec 21 08:13:35 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crc.c,v 1.12 2002/03/31 14:43:22 bjh21 Exp $   */
+/*     $NetBSD: crc.c,v 1.12.2.1 2003/12/21 08:13:35 tron Exp $        */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)crc.c      8.1 (Berkeley) 6/17/93";
 #else
-__RCSID("$NetBSD: crc.c,v 1.12 2002/03/31 14:43:22 bjh21 Exp $");
+__RCSID("$NetBSD: crc.c,v 1.12.2.1 2003/12/21 08:13:35 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -114,16 +114,19 @@
 int
 crc(fd, cval, clen)
        register int fd;
-       u_int32_t *cval, *clen;
+       u_int32_t *cval;
+       off_t *clen;
 {
        register u_char *p;
        register int nr;
-       register u_int32_t thecrc, len;
+       register u_int32_t thecrc;
+       off_t len;
        u_char buf[16 * 1024];
 
 #define        COMPUTE(var, ch)        (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)]
 
-       thecrc = len = 0;
+       thecrc = 0;
+       len = 0;
        while ((nr = read(fd, buf, sizeof(buf))) > 0)
                for (len += nr, p = buf; nr--; ++p) {
                        COMPUTE(thecrc, *p);



Home | Main Index | Thread Index | Old Index