git: 3513df4bcc17 - main - fstyp: fix build WITHOUT_ICONV

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Tue, 02 Nov 2021 18:55:07 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=3513df4bcc172b2b7b923ba62591490d5df1bf5a

commit 3513df4bcc172b2b7b923ba62591490d5df1bf5a
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2021-11-02 13:43:56 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2021-11-02 18:54:45 +0000

    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 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);