Fix some uninitialized memory problems in date format [caused ccaltst to fail]

X-Trac-URL: https://ssl.icu-project.org/trac/ticket/66



git-svn-id: http://source.icu-project.org/repos/icu/icu/trunk@135 0a8b766c-62c9-45f9-954d-7f2943c9ead0
This commit is contained in:
Steven R. Loomis 1999-10-28 02:02:53 +00:00
parent e0b887e2ff
commit a14a570663

View file

@ -2146,15 +2146,11 @@ TimeZone::getDisplayName(bool_t daylight, EDisplayType style, const Locale& loca
// We don't cache these because they're small and cheap to create.
UnicodeString tempID;
SimpleTimeZone *tz = daylight ?
// For the pure-DST zone, we use the month before JANUARY and
// the month after DECEMBER; if this fails to work at some future
// date because of increased error checking in SimpleTimeZone,
// change these parameters to JANUARY and DECEMBER, which will
// work equally well, but will be slower.
// For the pure-DST zone, we use JANUARY and DECEMBER
new SimpleTimeZone(getRawOffset(), getID(tempID),
Calendar::JANUARY - 1, 1, 0, 0,
Calendar::DECEMBER + 1, 31, 0, U_MILLIS_PER_DAY, status) :
Calendar::JANUARY , 1, 0, 0,
Calendar::DECEMBER , 31, 0, U_MILLIS_PER_DAY, status) :
new SimpleTimeZone(getRawOffset(), getID(tempID));
format.applyPattern(style == LONG ? "zzzz" : "z");
@ -2164,7 +2160,7 @@ TimeZone::getDisplayName(bool_t daylight, EDisplayType style, const Locale& loca
delete tz;
FieldPosition pos(FieldPosition::DONT_CARE);
return format.format(UDate(), result, pos); // Doesn't matter what date we use
return format.format(UDate(196262345678.), result, pos); // Must use a valid date here.
}