From e387c69929ca8efd74b18c003818eaf1aa72796e Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Wed, 13 Dec 2017 20:01:38 +0000 Subject: [PATCH] ICU-13489 Merging addtional change (r40723 - fixing AIX/older gcc build issues) in #13457 to maint-60 for 60.2 X-SVN-Rev: 40727 --- icu4c/source/i18n/calendar.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/icu4c/source/i18n/calendar.cpp b/icu4c/source/i18n/calendar.cpp index 4e22dff26445..092dc4c1d9e5 100644 --- a/icu4c/source/i18n/calendar.cpp +++ b/icu4c/source/i18n/calendar.cpp @@ -706,10 +706,10 @@ fTime(0), fLenient(TRUE), fZone(NULL), fRepeatedWallTime(UCAL_WALLTIME_LAST), -fSkippedWallTime(UCAL_WALLTIME_LAST), -validLocale(""), -actualLocale("") +fSkippedWallTime(UCAL_WALLTIME_LAST) { + validLocale[0] = 0; + actualLocale[0] = 0; clear(); if (U_FAILURE(success)) { return; @@ -734,10 +734,10 @@ fTime(0), fLenient(TRUE), fZone(NULL), fRepeatedWallTime(UCAL_WALLTIME_LAST), -fSkippedWallTime(UCAL_WALLTIME_LAST), -validLocale(""), -actualLocale("") +fSkippedWallTime(UCAL_WALLTIME_LAST) { + validLocale[0] = 0; + actualLocale[0] = 0; if (U_FAILURE(success)) { return; } @@ -768,10 +768,10 @@ fTime(0), fLenient(TRUE), fZone(NULL), fRepeatedWallTime(UCAL_WALLTIME_LAST), -fSkippedWallTime(UCAL_WALLTIME_LAST), -validLocale(""), -actualLocale("") +fSkippedWallTime(UCAL_WALLTIME_LAST) { + validLocale[0] = 0; + actualLocale[0] = 0; if (U_FAILURE(success)) { return; } @@ -830,6 +830,8 @@ Calendar::operator=(const Calendar &right) fNextStamp = right.fNextStamp; uprv_strncpy(validLocale, right.validLocale, sizeof(validLocale)); uprv_strncpy(actualLocale, right.actualLocale, sizeof(actualLocale)); + validLocale[sizeof(validLocale)-1] = 0; + actualLocale[sizeof(validLocale)-1] = 0; } return *this;