aboutsummaryrefslogtreecommitdiff
path: root/i18n
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-07-17 18:23:12 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-07-17 18:23:12 -0700
commit3a60c769c9c12c73ce97036e6ea0a21b5dbe130d (patch)
tree0eb74f9861ca9a28ed1c3f03bc184dffcaa78705 /i18n
parent3746dd7fd11de69d9443daa3960f3e712d8aa221 (diff)
downloadicu4c-3a60c769c9c12c73ce97036e6ea0a21b5dbe130d.tar.gz
import cl @133444
Diffstat (limited to 'i18n')
-rw-r--r--i18n/digitlst.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/i18n/digitlst.cpp b/i18n/digitlst.cpp
index 10ee0727..ef8f23ec 100644
--- a/i18n/digitlst.cpp
+++ b/i18n/digitlst.cpp
@@ -90,7 +90,7 @@ DigitList::~DigitList()
DigitList::DigitList(int capacity)
{
fBufferSize = capacity;
- fDecimalDigits = (char *) malloc(capacity);
+ fDecimalDigits = (char *) calloc(capacity, 1);
fDigits = fDecimalDigits + 1; // skip the decimal
clear();
}
@@ -239,9 +239,11 @@ DigitList::getDouble() /*const*/
*fDecimalDigits = gDecimal;
*(fDigits+fCount) = 'e'; // add an e after the digits.
+ // BEGIN android-changed
formatBase10(fDecimalAt,
fDigits + fCount + 1, // skip the 'e'
- MAX_DEC_DIGITS - fCount - 3); // skip the 'e' and '.'
+ fBufferSize - fCount - 3); // skip the 'e' and '.'
+ // END android-changed
value = uprv_strtod(fDecimalDigits, &end);
}