From 869702f8a759f0e93b7841ff6ea958558abd99e2 Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Tue, 9 Oct 2007 22:44:20 +0000 Subject: [PATCH] Move check of over/underflow after copy. Patch by Mark Tracy . git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25523 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSDecimal.m | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 321da7c44..7f1a7b39d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-10 Fred Kiefer + + * Source/NSDecimal.m (NSDecimalMultiplyByPowerOf10): Move check of + over/underflow after copy. Patch by Mark Tracy . + 2007-10-03 Richard Frith-Macdonald * Source/NSData.m: Fix ([-classForCoder:]) to return base class of diff --git a/Source/NSDecimal.m b/Source/NSDecimal.m index a0b39db96..06de5d720 100644 --- a/Source/NSDecimal.m +++ b/Source/NSDecimal.m @@ -780,9 +780,10 @@ NSDecimalPower(NSDecimal *result, const NSDecimal *n, unsigned power, NSRounding NSCalculationError NSDecimalMultiplyByPowerOf10(NSDecimal *result, const NSDecimal *n, short power, NSRoundingMode mode) { - int p = result->exponent + power; + int p; NSDecimalCopy(result, n); + p = result->exponent + power; if (p > 127) { result->validNumber = NO;