diff options
Diffstat (limited to 'engines/kyra/gui.cpp')
-rw-r--r-- | engines/kyra/gui.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 5581f636b1..d2e02671c9 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -306,10 +306,15 @@ void GUI::updateSaveList() { for (Common::StringList::const_iterator i = saveFileList.begin(); i != saveFileList.end(); ++i) { char s1 = 0, s2 = 0, s3 = 0; - s1 = (*i)[i->size()-3] - '0'; - s2 = (*i)[i->size()-2] - '0'; - s3 = (*i)[i->size()-1] - '0'; - if (s1 < 0 || s2 < 0 || s3 < 0 || s1 > 9 || s2 > 9 || s3 > 9) + s1 = (*i)[i->size()-3]; + s2 = (*i)[i->size()-2]; + s3 = (*i)[i->size()-1]; + if (!isdigit(s1) || !isdigit(s2) || !isdigit(s3)) + continue; + s1 -= '0'; + s2 -= '0'; + s3 -= '0'; + if (s1 == 9 && s2 == 9 && s3 == 9) continue; _saveSlots.push_back(s1*100+s2*10+s3); } |