From 212de513466eac2991421a4252abdbccf3e2c74e Mon Sep 17 00:00:00 2001 From: kh1 Date: Wed, 2 Apr 2014 10:21:25 +0200 Subject: Calm down the possibility of a buffer overflow. Still the maximum values do not fit exactly into the double, though way better than the previous overflow while passing a large qint64 as qint32 into the function. Fixes some progress issues I've noticed with very large files that I downloaded. Change-Id: I7c9ea1fbd8cdd454c3ffd5f952dd0118fdf11c28 Reviewed-by: Kai Koehne Reviewed-by: Niels Weber --- src/libs/kdtools/kdupdaterfiledownloader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/kdtools/kdupdaterfiledownloader.cpp b/src/libs/kdtools/kdupdaterfiledownloader.cpp index cbd4ee184..f2063c8c4 100644 --- a/src/libs/kdtools/kdupdaterfiledownloader.cpp +++ b/src/libs/kdtools/kdupdaterfiledownloader.cpp @@ -62,7 +62,7 @@ using namespace KDUpdater; using namespace QInstaller; -static double calcProgress(qint32 done, qint32 total) +static double calcProgress(qint64 done, qint64 total) { return total ? (double(done) / double(total)) : 0; } -- cgit v1.2.3