Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Warn if setlocale() fails
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
dwmw2 committed Aug 14, 2017
1 parent cecadff commit 2e7415f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.c
Expand Up @@ -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);
Expand Down

0 comments on commit 2e7415f

Please sign in to comment.