Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/fstyp usr.sbin/fstyp: Fix -Werror=conversion error.



details:   https://anonhg.NetBSD.org/src/rev/f1bceba3160b
branches:  trunk
changeset: 744632:f1bceba3160b
user:      fox <fox%NetBSD.org@localhost>
date:      Sat Feb 08 12:56:56 2020 +0000

description:
usr.sbin/fstyp: Fix -Werror=conversion error.

Type cast the size_t to uint32_t to prevent implicit type conversion errors.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@

diffstat:

 usr.sbin/fstyp/exfat.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1f4ddf90e2cf -r f1bceba3160b usr.sbin/fstyp/exfat.c
--- a/usr.sbin/fstyp/exfat.c    Sat Feb 08 12:53:29 2020 +0000
+++ b/usr.sbin/fstyp/exfat.c    Sat Feb 08 12:56:56 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exfat.c,v 1.2 2019/12/28 08:00:08 tkusumi Exp $        */
+/*     $NetBSD: exfat.c,v 1.3 2020/02/08 12:56:56 fox Exp $    */
 
 /*
  * Copyright (c) 2017 Conrad Meyer <cem%FreeBSD.org@localhost>
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: exfat.c,v 1.2 2019/12/28 08:00:08 tkusumi Exp $");
+__RCSID("$NetBSD: exfat.c,v 1.3 2020/02/08 12:56:56 fox Exp $");
 
 #include <sys/param.h>
 #include <sys/endian.h>
@@ -250,7 +250,7 @@
 
        fat_offset_sect = le32toh(ev->ev_fat_offset);
        clsect = fat_offset_sect + (cluster / (BPS / (uint32_t)sizeof(cluster)));
-       clsectoff = (cluster % (BPS / sizeof(cluster)));
+       clsectoff = (cluster % (BPS / (uint32_t)sizeof(cluster)));
 
        /* XXX This is pretty wasteful without a block cache for the FAT. */
        fatsect = read_sect(fp, clsect, BPS);



Home | Main Index | Thread Index | Old Index