aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2008-07-30 08:23:04 +0000
committerFilippos Karapetis2008-07-30 08:23:04 +0000
commit8941a96bf0742b35e04741d9841d4c1430201baa (patch)
tree3c36a6492b85377b5da54bf154c3c8492fd50324
parent3dbeeaf8a10a07491465657f6effebe341251635 (diff)
downloadscummvm-rg350-8941a96bf0742b35e04741d9841d4c1430201baa.tar.gz
scummvm-rg350-8941a96bf0742b35e04741d9841d4c1430201baa.tar.bz2
scummvm-rg350-8941a96bf0742b35e04741d9841d4c1430201baa.zip
Make sure that save game descriptions are 0-terminated
svn-id: r33438
-rw-r--r--engines/tinsel/saveload.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index 5cb149eb37..1a6cc1202a 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -136,6 +136,7 @@ static bool syncSaveGameHeader(Serializer &s, SaveGameHeader &hdr) {
s.syncAsUint32LE(hdr.ver);
s.syncBytes((byte *)hdr.desc, SG_DESC_LEN);
+ hdr.desc[SG_DESC_LEN - 1] = 0;
syncTime(s, hdr.dateTime);
@@ -291,6 +292,7 @@ int getList(void) {
strncpy(savedFiles[i].name, fname.c_str(), FNAMELEN);
strncpy(savedFiles[i].desc, hdr.desc, SG_DESC_LEN);
+ savedFiles[i].desc[SG_DESC_LEN - 1] = 0;
savedFiles[i].dateTime = hdr.dateTime;
++numSfiles;
@@ -405,6 +407,7 @@ static void DoSave(void) {
hdr.size = SAVEGAME_HEADER_SIZE;
hdr.ver = CURRENT_VER;
memcpy(hdr.desc, SaveSceneDesc, SG_DESC_LEN);
+ hdr.desc[SG_DESC_LEN - 1] = 0;
g_system->getTimeAndDate(hdr.dateTime);
if (!syncSaveGameHeader(s, hdr) || f->ioFailed()) {
goto save_failure;