diff options
author | kh1 <karsten.heimrich@digia.com> | 2014-04-02 10:21:25 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2014-04-03 11:08:12 +0200 |
commit | 212de513466eac2991421a4252abdbccf3e2c74e (patch) | |
tree | 72be3e867b49fb42d835204d1688b98557ce5df6 | |
parent | 476d7ec5ba7c9704542b17a8157e9ace6fddb448 (diff) |
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 <kai.koehne@digia.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
-rw-r--r-- | src/libs/kdtools/kdupdaterfiledownloader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |