From ef4913316ffc896b5c17882b58730f2129a8fe38 Mon Sep 17 00:00:00 2001 From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Fri, 4 Sep 2020 12:15:20 -0700 Subject: [PATCH] ICU-21271 Fix valgrind failure in dtptngen.cpp --- icu4c/source/i18n/dtptngen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icu4c/source/i18n/dtptngen.cpp b/icu4c/source/i18n/dtptngen.cpp index 02be4f054b8..32d3fc4db8d 100644 --- a/icu4c/source/i18n/dtptngen.cpp +++ b/icu4c/source/i18n/dtptngen.cpp @@ -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; } }