connectivity/source/commontools/dbconversion.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit c039ba3d68cb6668b672c299075417f65183c65a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Sep 29 09:27:49 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Sep 29 11:41:43 2021 +0200 ofz#39403 avoid Integer-overflow Change-Id: I3471e2fbd2b47dbc681aa3069794184eb9ab33e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122796 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx index 96b1f1dcfd0a..cae8470479c3 100644 --- a/connectivity/source/commontools/dbconversion.cxx +++ b/connectivity/source/commontools/dbconversion.cxx @@ -332,10 +332,10 @@ namespace dbtools css::util::Time DBTypeConversion::toTime(const double dVal, short nDigits) { - const sal_Int32 nDays = static_cast<sal_Int32>(dVal); + const double nDays = std::trunc(dVal); sal_Int64 nNS; { - double fSeconds((dVal - static_cast<double>(nDays)) * (fNanoSecondsPerDay / nanoSecInSec)); + double fSeconds((dVal - nDays) * (fNanoSecondsPerDay / nanoSecInSec)); fSeconds = ::rtl::math::round( fSeconds, nDigits ); nNS = fSeconds * nanoSecInSec; }