ICU-11746 static analysis fixes

X-SVN-Rev: 39282
This commit is contained in:
Steven R. Loomis 2016-09-19 18:52:48 +00:00
parent dd65e19e36
commit a2ee3b1f28
3 changed files with 3 additions and 2 deletions

View file

@ -664,6 +664,7 @@ Locale::setToBogus() {
*script = 0;
*country = 0;
fIsBogus = TRUE;
variantBegin = 0;
}
const Locale& U_EXPORT2

View file

@ -1030,7 +1030,7 @@ uprv_tzname(int n)
because the tzfile contents is underspecified.
This isn't guaranteed to work because it may not be a symlink.
*/
int32_t ret = (int32_t)readlink(TZDEFAULT, gTimeZoneBuffer, sizeof(gTimeZoneBuffer));
int32_t ret = (int32_t)readlink(TZDEFAULT, gTimeZoneBuffer, sizeof(gTimeZoneBuffer)-1);
if (0 < ret) {
int32_t tzZoneInfoLen = uprv_strlen(TZZONEINFO);
gTimeZoneBuffer[ret] = 0;

View file

@ -1822,7 +1822,7 @@ TZDBNames::createInstance(UResourceBundle* rb, const char* key) {
if (regions != NULL) {
char **p = regions;
for (int32_t i = 0; i < numRegions; p++, i++) {
uprv_free(p);
uprv_free(*p);
}
uprv_free(regions);
}