From 97d87b962d27975cb65fa7b0f95db95b58ead219 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Mon, 21 Apr 2008 17:48:32 +0000 Subject: [PATCH] ICU-5794 Fix a possible infinite loop in plurrule.cpp. X-SVN-Rev: 23815 --- icu4c/source/i18n/plurrule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/icu4c/source/i18n/plurrule.cpp b/icu4c/source/i18n/plurrule.cpp index bf4f0df52e..3738f41cb9 100644 --- a/icu4c/source/i18n/plurrule.cpp +++ b/icu4c/source/i18n/plurrule.cpp @@ -221,7 +221,8 @@ PluralRules::forLocale(const Locale& locale, UErrorCode& status) { char parentLocaleName[ULOC_FULLNAME_CAPACITY]; const char *curLocaleName=locale.getName(); int32_t localeNameLen=0; - while ((localeNameLen=uloc_getParent(curLocaleName, parentLocaleName, + uprv_strcpy(parentLocaleName, curLocaleName); + while ((localeNameLen=uloc_getParent(parentLocaleName, parentLocaleName, ULOC_FULLNAME_CAPACITY, &status)) > 0) { localeName = UnicodeString(parentLocaleName, -1, US_INV); Mutex lock;