]> granicus.if.org Git - icu/commitdiff
ICU-9980 DecimalFormat::parseCurrency() - init output currencty parameter.
authorAndy Heninger <andy.heninger@gmail.com>
Fri, 30 Aug 2013 22:16:21 +0000 (22:16 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Fri, 30 Aug 2013 22:16:21 +0000 (22:16 +0000)
X-SVN-Rev: 34156

icu4c/source/i18n/decimfmt.cpp

index 425db9dd94c42d8971c5f60b8057e43a0d1e88a5..878e6b39c30bd7a26d654e197ae81eebbeff4aae 100644 (file)
@@ -1976,6 +1976,11 @@ void DecimalFormat::parse(const UnicodeString& text,
     // clear any old contents in the result.  In particular, clears any DigitList
     //   that it may be holding.
     result.setLong(0);
+    if (currency != NULL) {
+        for (int32_t ci=0; ci<4; ci++) {
+            currency[ci] = 0;
+        }
+    }
 
     // Handle NaN as a special case: