Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/cksum Explicitly cast the number of bytes passed to ...



details:   https://anonhg.NetBSD.org/src/rev/7b4dd31ddbda
branches:  trunk
changeset: 931355:7b4dd31ddbda
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Apr 27 07:30:54 2020 +0000

description:
Explicitly cast the number of bytes passed to crc_buf() to size_t, as
we made sure it is positive already.
Fixes the build.

diffstat:

 usr.bin/cksum/crc.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 9bd02ac811bc -r 7b4dd31ddbda usr.bin/cksum/crc.c
--- a/usr.bin/cksum/crc.c       Mon Apr 27 05:28:17 2020 +0000
+++ b/usr.bin/cksum/crc.c       Mon Apr 27 07:30:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crc.c,v 1.20 2020/04/27 03:26:09 riastradh Exp $       */
+/*     $NetBSD: crc.c,v 1.21 2020/04/27 07:30:54 martin 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.20 2020/04/27 03:26:09 riastradh Exp $");
+__RCSID("$NetBSD: crc.c,v 1.21 2020/04/27 07:30:54 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -124,7 +124,7 @@
        thecrc = 0;
        len = 0;
        while ((nr = read(fd, buf, sizeof(buf))) > 0) {
-               thecrc = crc_buf(thecrc, buf, nr);
+               thecrc = crc_buf(thecrc, buf, (size_t)nr);
                len += nr;
        }
        if (nr < 0)



Home | Main Index | Thread Index | Old Index