check init locale (issues 3)
This commit is contained in:
parent
32d1bcfa20
commit
778f674e85
1 changed files with 3 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue