X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a12d28cdfd69f447a8cf5815ce5a84284788b86e..f139ce94a95fd895d8b4b74826660ab076ed5129:/test/getcwidth.c diff --git a/test/getcwidth.c b/test/getcwidth.c index 4a8122b6..c1717e17 100644 --- a/test/getcwidth.c +++ b/test/getcwidth.c @@ -38,7 +38,10 @@ main(int argc, char *argv[]) wchar_t c; int i; - setlocale(LC_ALL, ""); + if (! setlocale(LC_ALL, "")) { + fprintf(stderr, "setlocale failed, check your LC_ALL, " + "LC_CTYPE, and LANG environment variables\n"); + } if (argc < 2) usage(argv[0]); @@ -111,7 +114,7 @@ getwidth(const char *string) * at a time. */ - mbtowc(NULL, NULL, 0); + if (mbtowc(NULL, NULL, 0)) {} while (charleft > 0) { int clen;