From f0edd7ef8f286a7c5bbe22a375e7cd4dfc9b8c08 Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 13 Mar 2003 23:35:30 +0000 Subject: - Align the function prototype of the external `crc' function with how `crc' is actually defined. - Remove an unnecessary `extern' variable declaration. Data type corrections: - Define a variable which contains a file byte offset value as type off_t as required by the `crc' function. - Change the type of a variable carrying a CRC checksum from `u_long' to `uint32_t'. - Substitute the wrong `extern' variable declaration of `crc_total' by putting a correct one in the shared header extern.h. `crc_total' is defined as an `uint32_t', thus fixing incorrect mtree checksums on big-endian LP64 machines. --- usr.sbin/mtree/mtree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'usr.sbin/mtree/mtree.c') diff --git a/usr.sbin/mtree/mtree.c b/usr.sbin/mtree/mtree.c index c2c4710..c4ea315 100644 --- a/usr.sbin/mtree/mtree.c +++ b/usr.sbin/mtree/mtree.c @@ -55,8 +55,6 @@ static const char rcsid[] = #include "mtree.h" #include "extern.h" -extern long int crc_total; - int ftsoptions = FTS_PHYSICAL; int cflag, dflag, eflag, iflag, nflag, qflag, rflag, sflag, uflag, Uflag; u_int keys; @@ -126,7 +124,7 @@ main(int argc, char *argv[]) break; case 's': sflag = 1; - crc_total = ~strtol(optarg, &p, 0); + crc_total = ~strtoul(optarg, &p, 0); if (*p) errx(1, "illegal seed value -- %s", optarg); case 'U': -- cgit v1.1