Module Name: src
Committed By: fox
Date: Sat Feb 8 12:56:56 UTC 2020
Modified Files:
src/usr.sbin/fstyp: exfat.c
Log Message:
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@
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/exfat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/fstyp/exfat.c
diff -u src/usr.sbin/fstyp/exfat.c:1.2 src/usr.sbin/fstyp/exfat.c:1.3
--- src/usr.sbin/fstyp/exfat.c:1.2 Sat Dec 28 08:00:08 2019
+++ src/usr.sbin/fstyp/exfat.c Sat Feb 8 12:56:56 2020
@@ -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 <[email protected]>
@@ -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 @@ exfat_fat_next(FILE *fp, const struct ex
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);