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.10 (requested by klein...
details: https://anonhg.NetBSD.org/src/rev/c6dd6732aec2
branches: netbsd-1-6
changeset: 531036:c6dd6732aec2
user: tron <tron%NetBSD.org@localhost>
date: Sun Dec 21 08:13:25 2003 +0000
description:
Pull up revision 1.10 (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/sum1.c | 9 +++++----
usr.bin/cksum/sum2.c | 13 ++++++++-----
2 files changed, 13 insertions(+), 9 deletions(-)
diffs (73 lines):
diff -r a31ff9c1a63f -r c6dd6732aec2 usr.bin/cksum/sum1.c
--- a/usr.bin/cksum/sum1.c Sun Dec 21 08:13:20 2003 +0000
+++ b/usr.bin/cksum/sum1.c Sun Dec 21 08:13:25 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sum1.c,v 1.8 2002/03/31 14:43:23 bjh21 Exp $ */
+/* $NetBSD: sum1.c,v 1.8.2.1 2003/12/21 08:13:25 tron Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)sum1.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: sum1.c,v 1.8 2002/03/31 14:43:23 bjh21 Exp $");
+__RCSID("$NetBSD: sum1.c,v 1.8.2.1 2003/12/21 08:13:25 tron Exp $");
#endif
#endif /* not lint */
@@ -50,9 +50,10 @@
int
csum1(fd, cval, clen)
register int fd;
- u_int32_t *cval, *clen;
+ u_int32_t *cval;
+ off_t *clen;
{
- register u_int32_t total;
+ register off_t total;
register int nr;
register u_int thecrc;
register u_char *p;
diff -r a31ff9c1a63f -r c6dd6732aec2 usr.bin/cksum/sum2.c
--- a/usr.bin/cksum/sum2.c Sun Dec 21 08:13:20 2003 +0000
+++ b/usr.bin/cksum/sum2.c Sun Dec 21 08:13:25 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sum2.c,v 1.8 2002/03/31 14:43:23 bjh21 Exp $ */
+/* $NetBSD: sum2.c,v 1.8.2.1 2003/12/21 08:13:25 tron Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)sum2.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: sum2.c,v 1.8 2002/03/31 14:43:23 bjh21 Exp $");
+__RCSID("$NetBSD: sum2.c,v 1.8.2.1 2003/12/21 08:13:25 tron Exp $");
#endif
#endif /* not lint */
@@ -50,9 +50,11 @@
int
csum2(fd, cval, clen)
register int fd;
- u_int32_t *cval, *clen;
+ u_int32_t *cval;
+ off_t *clen;
{
- register u_int32_t thecrc, total;
+ register u_int32_t thecrc;
+ register off_t total;
register int nr;
register u_char *p;
u_char buf[8192];
@@ -64,7 +66,8 @@
* r = s % 2^16 + (s % 2^32) / 2^16
* thecrc = (r % 2^16) + r / 2^16
*/
- thecrc = total = 0;
+ thecrc = 0;
+ total = 0;
while ((nr = read(fd, buf, sizeof(buf))) > 0)
for (total += nr, p = buf; nr--; ++p)
thecrc += *p;
Home |
Main Index |
Thread Index |
Old Index