1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-05-18 00:48:57 -04:00

Additional check whether LANGUAGE is not NULL.

This commit is contained in:
Witold Filipczyk 2010-09-19 15:29:55 +02:00 committed by witekfl
parent f93d5ccd80
commit a9c02bbf01

View File

@ -206,10 +206,13 @@ set_language(int language)
/* We never free() this, purely intentionally. */ /* We never free() this, purely intentionally. */
LANGUAGE = malloc(256); LANGUAGE = malloc(256);
} }
strcpy(LANGUAGE, language_to_iso639(language)); if (LANGUAGE) {
p = strchr(LANGUAGE, '-'); strcpy(LANGUAGE, language_to_iso639(language));
if (p) p = strchr(LANGUAGE, '-');
*p = '_'; if (p) {
*p = '_';
}
}
/* Propagate the change to gettext. From the info manual. */ /* Propagate the change to gettext. From the info manual. */
{ {