From a73ec1705489a18c3b9cdcbcb21b99d31a93c765 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Sat, 4 Sep 2010 01:01:45 +0000 Subject: [PATCH] ICU-7382 [srl fixing crash] make sure localeName is initialized. X-SVN-Rev: 28573 --- icu4c/source/common/putil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icu4c/source/common/putil.c b/icu4c/source/common/putil.c index 8975c7de11..d11749d767 100644 --- a/icu4c/source/common/putil.c +++ b/icu4c/source/common/putil.c @@ -1876,6 +1876,7 @@ int_getDefaultCodepage() const char *localeName = NULL; const char *name = NULL; + localeName = uprv_getPOSIXIDForDefaultCodepage(); uprv_memset(codesetName, 0, sizeof(codesetName)); #if U_HAVE_NL_LANGINFO_CODESET /* When available, check nl_langinfo first because it usually gives more @@ -1908,7 +1909,6 @@ int_getDefaultCodepage() Maybe the application used setlocale already. */ uprv_memset(codesetName, 0, sizeof(codesetName)); - localeName = uprv_getPOSIXIDForDefaultCodepage(); name = getCodepageFromPOSIXID(localeName, codesetName, sizeof(codesetName)); if (name) { /* if we can find the codeset name from setlocale, return that. */