Module Name: src
Committed By: christos
Date: Thu Dec 2 14:26:12 UTC 2021
Modified Files:
src/usr.sbin/fstyp: ntfs.c
Log Message:
PR/56530: RVP: fix iconv open error.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/ntfs.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/ntfs.c
diff -u src/usr.sbin/fstyp/ntfs.c:1.2 src/usr.sbin/fstyp/ntfs.c:1.3
--- src/usr.sbin/fstyp/ntfs.c:1.2 Sat Dec 28 03:22:30 2019
+++ src/usr.sbin/fstyp/ntfs.c Thu Dec 2 09:26:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs.c,v 1.2 2019/12/28 08:22:30 tkusumi Exp $ */
+/* $NetBSD: ntfs.c,v 1.3 2021/12/02 14:26:12 christos Exp $ */
/*-
* Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -35,10 +35,11 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: ntfs.c,v 1.2 2019/12/28 08:22:30 tkusumi Exp $");
+__RCSID("$NetBSD: ntfs.c,v 1.3 2021/12/02 14:26:12 christos Exp $");
#include <err.h>
#include <iconv.h>
+#include <langinfo.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -108,8 +109,7 @@ convert_label(const void *label /* LE */
iconv_t cd;
size_t rc;
- /* dstname="" means convert to the current locale. */
- cd = iconv_open("", NTFS_ENC);
+ cd = iconv_open(nl_langinfo(CODESET), NTFS_ENC);
if (cd == (iconv_t)-1) {
warn("ntfs: Could not open iconv");
return;