From 3513df4bcc172b2b7b923ba62591490d5df1bf5a Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 2 Nov 2021 09:43:56 -0400 Subject: [PATCH] fstyp: fix build WITHOUT_ICONV Reported by: Michael Dexter, Build Option Survey Sponsored by: The FreeBSD Foundation --- usr.sbin/fstyp/exfat.c | 5 +++++ usr.sbin/fstyp/ntfs.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/usr.sbin/fstyp/exfat.c b/usr.sbin/fstyp/exfat.c index 3f10cb6a9e5..d92d9c82842 100644 --- a/usr.sbin/fstyp/exfat.c +++ b/usr.sbin/fstyp/exfat.c @@ -365,6 +365,11 @@ fstyp_exfat(FILE *fp, char *label, size_t size) #ifdef WITH_ICONV if (show_label) exfat_find_label(fp, ev, bytespersec, label, size); +#else + if (show_label) { + warnx("label not available without iconv support"); + memset(label, 0, size); + } #endif out: diff --git a/usr.sbin/fstyp/ntfs.c b/usr.sbin/fstyp/ntfs.c index 0ce1fa81181..c286d950dc2 100644 --- a/usr.sbin/fstyp/ntfs.c +++ b/usr.sbin/fstyp/ntfs.c @@ -179,6 +179,11 @@ fstyp_ntfs(FILE *fp, char *label, size_t size) } ok: +#else + if (show_label) { + warnx("label not available without iconv support"); + memset(label, 0, size); + } #endif /* WITH_ICONV */ free(bf); free(filerecp); -- 2.45.0