From 3bf4f3fcbe342d5ddb805e66de1df29541541410 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 19 Sep 2016 10:03:30 +0200 Subject: FULLPIPE: Fix crash at load dialog initialization --- engines/fullpipe/gameloader.cpp | 3 ++- engines/fullpipe/modal.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'engines/fullpipe') diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 55db7fb8e3..d1f27814c0 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -712,7 +712,8 @@ bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header) // Read in the string header.saveName.clear(); char ch; - while ((ch = (char)in->readByte()) != '\0') header.saveName += ch; + while ((ch = (char)in->readByte()) != '\0') + header.saveName += ch; // Get the thumbnail header.thumbnail = Graphics::loadThumbnail(*in); diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 883642952d..5f8afbc761 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -1601,7 +1601,7 @@ void ModalSaveGame::setup(Scene *sc, int mode) { } else { w = 0; - for (int j = 0; j < 16; j++) { + for (uint j = 0; j < _arrayL.size(); j++) { _arrayL[j]->getDimensions(&point); w += point.x + 2; } @@ -1640,7 +1640,11 @@ bool ModalSaveGame::getFileInfo(int slot, FileInfo *fileinfo) { SaveStateDescriptor desc(slot, header.saveName); char res[17]; - snprintf(res, 17, "%s %s", desc.getSaveDate().c_str(), desc.getSaveTime().c_str()); + // FIXME. HACK. TODO: Set proper dates + desc.setSaveDate(2016, 9, 18); + desc.setSaveTime(9, 56); + + snprintf(res, 17, "%s %s", desc.getSaveDate().c_str(), desc.getSaveTime().c_str()); for (int i = 0; i < 16; i++) { switch(res[i]) { -- cgit v1.2.3