ICU-21271 Fix valgrind failure in dtptngen.cpp

This commit is contained in:
Jeff Genovy 2020-09-04 12:15:20 -07:00
parent 8e04bf016d
commit ef4913316f

View File

@ -893,7 +893,7 @@ DateTimePatternGenerator::getCalendarTypeToUse(const Locale& locale, CharString&
err = localStatus;
return;
}
if (calendarTypeLen < ULOC_KEYWORDS_CAPACITY) {
if (calendarTypeLen > 0 && calendarTypeLen < ULOC_KEYWORDS_CAPACITY) {
destination.clear().append(calendarType, -1, err);
if (U_FAILURE(err)) { return; }
}