ICU-5794 Fix a possible infinite loop in plurrule.cpp.

X-SVN-Rev: 23815
This commit is contained in:
Michael Ow 2008-04-21 17:48:32 +00:00
parent 591379e224
commit 97d87b962d

View File

@ -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;