aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2021-11-02 13:43:56 +0000
committerEd Maste <emaste@FreeBSD.org>2021-11-02 18:54:45 +0000
commit3513df4bcc172b2b7b923ba62591490d5df1bf5a (patch)
tree2b7448a4bf4a9408e6af47599482762ee5755e62
parent1a8f198fa66518e6d249fa8aa765ec6e50a4fbab (diff)
downloadsrc-3513df4bcc172b2b7b923ba62591490d5df1bf5a.tar.gz
src-3513df4bcc172b2b7b923ba62591490d5df1bf5a.zip
fstyp: fix build WITHOUT_ICONV
Reported by: Michael Dexter, Build Option Survey Sponsored by: The FreeBSD Foundation
-rw-r--r--usr.sbin/fstyp/exfat.c5
-rw-r--r--usr.sbin/fstyp/ntfs.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/usr.sbin/fstyp/exfat.c b/usr.sbin/fstyp/exfat.c
index 3f10cb6a9e5a..d92d9c828427 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 0ce1fa81181a..c286d950dc2b 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);