From a9c02bbf0105216bf69bdef78f46c617ec1ac4cf Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 19 Sep 2010 15:29:55 +0200 Subject: [PATCH] Additional check whether LANGUAGE is not NULL. --- src/intl/gettext/libintl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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. */ {