summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-12-13 00:09:42 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-12-14 03:27:21 +0100
commit49bb030e9b9ef6b61c8a309a84a0ac78218db971 (patch)
treebe1cdc1e4561ef0c19df3cd8a8750c88e895eb3b /sal
parentab125155cf576e6ad1725947309cbe7eee9e8b0f (diff)
fix crash for std::numeric_limits<int>::min() in our math lib impl
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/source/math.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx
index 947f733a9428..67b3a513787c 100644
--- a/sal/rtl/source/math.cxx
+++ b/sal/rtl/source/math.cxx
@@ -59,7 +59,9 @@ static double getN10Exp( int nExp )
{
if ( nExp < 0 )
{
- if ( -nExp <= n10Count )
+ // && -nExp > 0 necessary for std::numeric_limits<int>::min()
+ // because -nExp = nExp
+ if ( -nExp <= n10Count && -nExp > 0 )
return n10s[1][-nExp-1];
else
return pow( 10.0, static_cast<double>( nExp ) );