From 48c1d819bdf112754f3d7ad33f499837018f0759 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Fri, 9 Jan 2009 10:08:38 +0100 Subject: Fixed nonsensical percent values in update dialog. --- src/gui/updatewindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 891fa769..c07e0643 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -229,8 +229,9 @@ int UpdaterWindow::updateProgress(void *ptr, float progress = dn / dt; UpdaterWindow *uw = reinterpret_cast(ptr); - if (progress < 0) progress = 0.0f; - if (progress > 1) progress = 1.0f; + if(progress != progress) progress = 0.0f; // check for NaN + if (progress < 0.0f) progress = 0.0f; // no idea how this could ever happen, but why not check for it anyway. + if (progress > 1.0f) progress = 1.0f; uw->setLabel( uw->mCurrentFile + " (" + toString((int) (progress * 100)) + "%)"); -- cgit v1.2.3-70-g09d2