diff --git a/src/intl/gettext/libintl.c b/src/intl/gettext/libintl.c index cde480d45..2e798b528 100644 --- a/src/intl/gettext/libintl.c +++ b/src/intl/gettext/libintl.c @@ -206,10 +206,13 @@ set_language(int language) /* We never free() this, purely intentionally. */ LANGUAGE = malloc(256); } - strcpy(LANGUAGE, language_to_iso639(language)); - p = strchr(LANGUAGE, '-'); - if (p) - *p = '_'; + if (LANGUAGE) { + strcpy(LANGUAGE, language_to_iso639(language)); + p = strchr(LANGUAGE, '-'); + if (p) { + *p = '_'; + } + } /* Propagate the change to gettext. From the info manual. */ {