aboutsummaryrefslogtreecommitdiff
path: root/backends/saves
diff options
context:
space:
mode:
Diffstat (limited to 'backends/saves')
-rw-r--r--backends/saves/default/default-saves.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index 44fd48bb7e..e9a4165ddb 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -360,7 +360,10 @@ void DefaultSaveFileManager::saveTimestamps(Common::HashMap<Common::String, uint
}
for (Common::HashMap<Common::String, uint32>::iterator i = timestamps.begin(); i != timestamps.end(); ++i) {
- Common::String data = i->_key + Common::String::format(" %u\n", i->_value);
+ uint32 v = i->_value;
+ if (v < 1) v = 1; // 0 timestamp is treated as EOF up there, so we should never save zeros
+
+ Common::String data = i->_key + Common::String::format(" %u\n", v);
if (f.write(data.c_str(), data.size()) != data.size()) {
warning("DefaultSaveFileManager: failed to write timestamps data into '%s'", filename.c_str());
return;