aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/saveload-dialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index c8f7556e66..cd0f96d60c 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -882,7 +882,7 @@ void SaveLoadChooserGrid::updateSaves() {
}
}
- const uint numPages = (_entriesPerPage != 0) ? (_saveList.size() / _entriesPerPage + 1) : 1;
+ const uint numPages = (_entriesPerPage != 0 && !_saveList.empty()) ? ((_saveList.size() + _entriesPerPage - 1) / _entriesPerPage) : 1;
_pageDisplay->setLabel(Common::String::format("%u/%u", _curPage + 1, numPages));
if (_curPage > 0)