diff options
-rw-r--r-- | engines/sword1/sword1.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 378d3b84bb..70b528c437 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -222,24 +222,23 @@ SaveStateList SwordMetaEngine::listSaves(const char *target) const { uint pos = 0; do { stop = in->readByte(); - if (pos < (sizeof(saveDesc) - 1)) { - if ((stop == 10) || (stop == 255) || (in->eos())) { + if (pos < (sizeof(saveDesc) - 1)) { + if ((stop == 10) || (stop == 255) || (in->eos())) saveDesc[pos++] = '\0'; - } - else if (stop >= 32) { + else if (stop >= 32) saveDesc[pos++] = stop; - } } } while ((stop != 10) && (stop != 255) && (!in->eos())); + if (saveDesc[0] != 0) { saveList.push_back(SaveStateDescriptor(slotNum, saveDesc, *file)); file++; } } while ((stop != 255) && (!in->eos())); } - + delete in; - + return saveList; } |