aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-04-03 23:09:31 +0200
committerEugene Sandulenko2016-04-03 23:10:55 +0200
commit0925e9cd2966111ffde6f9de47d95869c4a74dc3 (patch)
treee390f839298dc6363cda1bef09c97f36c7fbb090
parent717840b0063d029083f09e460836eb6ee8b7bb7b (diff)
downloadscummvm-rg350-0925e9cd2966111ffde6f9de47d95869c4a74dc3.tar.gz
scummvm-rg350-0925e9cd2966111ffde6f9de47d95869c4a74dc3.tar.bz2
scummvm-rg350-0925e9cd2966111ffde6f9de47d95869c4a74dc3.zip
UPDATES: Fix endless loop
-rw-r--r--common/updates.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/updates.cpp b/common/updates.cpp
index 552324ef5a..4174a96c56 100644
--- a/common/updates.cpp
+++ b/common/updates.cpp
@@ -41,9 +41,11 @@ const int *UpdateManager::getUpdateIntervals() {
int UpdateManager::normalizeInterval(int interval) {
const int *val = updateIntervals;
- while (*val != -1)
+ while (*val != -1) {
if (*val > interval)
return *val;
+ val++;
+ }
return val[-1]; // Return maximal acceptable value
}