Buglets found by static code inspection, including a whopper in divRound.

This commit is contained in:
JoelKatz
2013-04-27 00:35:16 -07:00
parent 09c37874a2
commit 46c1488484
12 changed files with 20 additions and 21 deletions

View File

@@ -271,7 +271,7 @@ STAmount STAmount::divRound(const STAmount& num, const STAmount& den,
--denOffset;
}
bool resultNegative = num.mIsNegative != num.mIsNegative;
bool resultNegative = num.mIsNegative != den.mIsNegative;
// Compute (numerator * 10^17) / denominator
CBigNum v;
if ((BN_add_word64(&v, numVal) != 1) || (BN_mul_word64(&v, tenTo17) != 1))