diff options
author | Johannes Schickel | 2012-09-26 02:49:24 +0200 |
---|---|---|
committer | Johannes Schickel | 2012-09-26 02:59:32 +0200 |
commit | 40fb004509620323a466ee1f49addc773094e21f (patch) | |
tree | d8f918efcd368077377a3c6fec71dbc41ab7e941 | |
parent | bc1743b225597715164e3d2701b2c4b5731415a4 (diff) | |
download | scummvm-rg350-40fb004509620323a466ee1f49addc773094e21f.tar.gz scummvm-rg350-40fb004509620323a466ee1f49addc773094e21f.tar.bz2 scummvm-rg350-40fb004509620323a466ee1f49addc773094e21f.zip |
GUI: Fix maximum page number calculation in grid chooser.
This avoids a off by one error in some cases.
-rw-r--r-- | gui/saveload-dialog.cpp | 2 |
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) |