]> diplodocus.org Git - nmh/blobdiff - test/getcwidth.c
sbr/utils.c: Add HasSuffix(s, suffix).
[nmh] / test / getcwidth.c
index 4a8122b6e9170b0e085981962706d65b74f24f88..c1717e17f58334976e3358503f8809fee52a735a 100644 (file)
@@ -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;