]> granicus.if.org Git - icu/commitdiff
ICU-20441 fix uninitialized fHasHanYearChar
authorPeter Edberg <pedberg@unicode.org>
Fri, 22 Feb 2019 07:17:37 +0000 (23:17 -0800)
committerpedberg-icu <42151464+pedberg-icu@users.noreply.github.com>
Fri, 22 Feb 2019 07:27:33 +0000 (23:27 -0800)
icu4c/source/i18n/smpdtfmt.cpp
icu4c/source/test/intltest/dtifmtts.cpp

index 414dfffab8fda1498614a8d13d9a553fc38bc24f..9ab765791fb54477534ae1d494274386145a60d3 100644 (file)
@@ -4217,6 +4217,7 @@ SimpleDateFormat::tzFormat(UErrorCode &status) const {
 void SimpleDateFormat::parsePattern() {
     fHasMinute = FALSE;
     fHasSecond = FALSE;
+    fHasHanYearChar = FALSE;
 
     int len = fPattern.length();
     UBool inQuote = FALSE;
index 4b38a3dc60ec75cee5a1d3edd5f238bcc7f914f4..44bfcdddfc6f7751023bf7964819c19b247a3054 100644 (file)
@@ -1064,7 +1064,7 @@ void DateIntervalFormatTest::testFormat() {
 
         "ja-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00",  "GyMMMd", "\\u662D\\u548C64\\u5E741\\u67085\\u65E5\\uFF5E\\u5E73\\u6210\\u5143\\u5E741\\u670815\\u65E5",
 
-        "ja-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00",  "GGGGGyMd", "S64/1/5\\uFF5EH\\u5143/1/15", // The GGGGG/G forces inheritance from a different pattern, no padding
+        "ja-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00",  "GGGGGyMd", "S64/1/5\\uFF5EH1/1/15", // The GGGGG/G forces inheritance from a different pattern, no padding
 
         "ja-u-ca-japanese", "H 31 04 15 09:00:00", JP_ERA_2019_NARROW " 1 05 15 09:00:00", "GGGGGyMd", "H31/4/15\\uFF5E" JP_ERA_2019_NARROW "1/5/15",