check init locale (issues 3)

This commit is contained in:
iratqq 2010-02-14 13:58:20 +00:00
commit 778f674e85

View file

@ -91,7 +91,9 @@ main(int argc, char **argv)
loc = setlocale(LC_CTYPE, "");
if (strcmp(loc, "ja_JP.SJIS") == 0) {
if (!loc) {
fprintf(stderr, "Warning: Locale is not found.\n");
} else if (strcmp(loc, "ja_JP.SJIS") == 0) {
current_locale = LC_CTYPE_SHIFTJIS;
} else if (strncmp(loc, "ja", 2) != 0 &&
strncmp(loc, "Ja", 2) != 0) {