ICU-2942 Don't go off the end of the string.

X-SVN-Rev: 13325
This commit is contained in:
George Rhoten 2003-10-06 21:13:54 +00:00
parent 6154b69b6c
commit c2fbe47c86

View file

@ -766,10 +766,12 @@ uloc_getVariant(const char* localeID,
localeID = scriptID;
}
/* Skip the Country */
_getCountry(localeID+1, NULL, 0, &localeID);
if(_isIDSeparator(*localeID)) {
haveVariant=TRUE;
i=_getVariant(localeID+1, *localeID, variant, variantCapacity);
if (_isIDSeparator(*localeID)) {
_getCountry(localeID+1, NULL, 0, &localeID);
if(_isIDSeparator(*localeID)) {
haveVariant=TRUE;
i=_getVariant(localeID+1, *localeID, variant, variantCapacity);
}
}
}