summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-06-27 08:51:02 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-06-27 09:29:32 +0200
commitac146c16c0f4707aa8a26e479902a124e4e1b7e4 (patch)
tree9c94dc44ef35e937fa607fef90b4263b7f47c10b /connectivity
parentb45b566e172938fd82f2be610c6c9dace87d4248 (diff)
fdo#66216 fix DBTypeConversion::toTime overflow
Change-Id: I0aba2344afde94226cfbac5b3221e827e6774b3a
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/dbconversion.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index c90c0e76b619..92feacafe4c2 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -354,7 +354,7 @@ namespace dbtools
Time DBTypeConversion::toTime(double dVal)
{
sal_Int32 nDays = (sal_Int32)dVal;
- sal_Int32 nNS = sal_Int32((dVal - (double)nDays) * fNanoSecondsPerDay + 0.5);
+ sal_Int64 nNS = static_cast<sal_Int64>((dVal - (double)nDays) * fNanoSecondsPerDay + 0.5);
sal_Int16 nSign;
if ( nNS < 0 )
@@ -368,7 +368,7 @@ namespace dbtools
Time xRet;
// normalize time
// we have to sal_Int32 here because otherwise we get an overflow
- sal_Int32 nNanoSeconds = nNS;
+ sal_Int64 nNanoSeconds = nNS;
sal_Int32 nSeconds = nNanoSeconds / nanoSecInSec;
sal_Int32 nMinutes = nSeconds / secInMin;