ICU-97 Fixed the case where fCount accidentally becomes negative.

X-SVN-Rev: 3475
This commit is contained in:
George Rhoten 2001-01-24 18:32:11 +00:00
parent c47b7bb2bd
commit 0e5e9a816c
2 changed files with 2 additions and 2 deletions

View File

@ -219,7 +219,7 @@ DigitList::fitsIntoLong(UBool ignoreNegativeZero)
// Trim trailing zeros after the decimal point. This does not change
// the represented value.
while (fCount > fDecimalAt && fDigits[fCount - 1] == '0')
while (fCount > fDecimalAt && fCount > 0 && fDigits[fCount - 1] == '0')
--fCount;
if (fCount == 0) {

View File

@ -219,7 +219,7 @@ DigitList::fitsIntoLong(UBool ignoreNegativeZero)
// Trim trailing zeros after the decimal point. This does not change
// the represented value.
while (fCount > fDecimalAt && fDigits[fCount - 1] == '0')
while (fCount > fDecimalAt && fCount > 0 && fDigits[fCount - 1] == '0')
--fCount;
if (fCount == 0) {