[Pkg-owncloud-commits] [owncloud-client] 30/120: Progress: Robust against bad 'completed' values #3579
Sandro Knauß
hefee-guest at moszumanska.debian.org
Mon Aug 24 00:02:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit e0cf5c3920a890bdc3ff67d6a505693ba8a61cbb
Author: Christian Kamm <mail at ckamm.de>
Date: Tue Aug 11 10:44:27 2015 +0200
Progress: Robust against bad 'completed' values #3579
Increasing the 'total' for bogus values of 'completed' is a bad idea.
---
src/libsync/progressdispatcher.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/libsync/progressdispatcher.cpp b/src/libsync/progressdispatcher.cpp
index 9627ff3..b39b87c 100644
--- a/src/libsync/progressdispatcher.cpp
+++ b/src/libsync/progressdispatcher.cpp
@@ -316,9 +316,8 @@ void ProgressInfo::Progress::update()
void ProgressInfo::Progress::setCompleted(quint64 completed)
{
- _completed = completed;
- _prevCompleted = qMin(_prevCompleted, completed);
- _total = qMax(_total, completed);
+ _completed = qMin(completed, _total);
+ _prevCompleted = qMin(_prevCompleted, _completed);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list