From 2e7415faf02b8d9a0d809c537a25bcbff10cc2ef Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 31 May 2017 11:37:00 +0100 Subject: [PATCH] Warn if setlocale() fails Signed-off-by: David Woodhouse --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 8ea298fd..a18bfd22 100644 --- a/main.c +++ b/main.c @@ -1093,7 +1093,9 @@ int main(int argc, char **argv) bindtextdomain("openconnect", LOCALEDIR); #endif - setlocale(LC_ALL, ""); + if (!setlocale(LC_ALL, "")) + fprintf(stderr, + _("WARNING: Cannot set locale: %s\n"), strerror(errno)); #ifdef HAVE_NL_LANGINFO charset = nl_langinfo(CODESET);