ICU-11809 Null terminate buffer in initCurrency

X-SVN-Rev: 38090
This commit is contained in:
Michael Ow 2015-11-19 18:58:42 +00:00
parent 25f9110090
commit 257d5a0a27
2 changed files with 3 additions and 1 deletions

View File

@ -1222,6 +1222,7 @@ void MeasureUnit::initCurrency(const char *isoCurrency) {
fSubTypeId = result - gOffsets[fTypeId];
} else {
uprv_strncpy(fCurrency, isoCurrency, UPRV_LENGTHOF(fCurrency));
fCurrency[3] = 0;
}
}

View File

@ -276,7 +276,8 @@ NumberFormat::operator=(const NumberFormat& rhs)
fMaxFractionDigits = rhs.fMaxFractionDigits;
fMinFractionDigits = rhs.fMinFractionDigits;
fParseIntegerOnly = rhs.fParseIntegerOnly;
u_strncpy(fCurrency, rhs.fCurrency, 4);
u_strncpy(fCurrency, rhs.fCurrency, 3);
fCurrency[3] = 0;
fLenient = rhs.fLenient;
fCapitalizationContext = rhs.fCapitalizationContext;
}