From 611bea7d735df4e318001a6fb3cc5c398fc7dcf6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 16 Jun 2019 14:48:53 -0700 Subject: GLK: ADVSYS: Fix savegame area setup --- engines/glk/advsys/advsys.cpp | 5 ++++- engines/glk/advsys/game.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/glk/advsys/advsys.cpp b/engines/glk/advsys/advsys.cpp index ff0bf62116..4e2451e79b 100644 --- a/engines/glk/advsys/advsys.cpp +++ b/engines/glk/advsys/advsys.cpp @@ -97,13 +97,16 @@ bool AdvSys::singleAction() { if (execute(_afterOffset) == ABORT) return false; break; + + default: + break; } return true; } Common::Error AdvSys::readSaveData(Common::SeekableReadStream *rs) { - if ((int)rs->size() != _saveSize) + if (rs->size() != (int)_saveSize) return Common::kReadingFailed; rs->read(_saveArea, rs->size()); diff --git a/engines/glk/advsys/game.cpp b/engines/glk/advsys/game.cpp index d051a352b6..eca145176c 100644 --- a/engines/glk/advsys/game.cpp +++ b/engines/glk/advsys/game.cpp @@ -28,8 +28,8 @@ namespace Glk { namespace AdvSys { void Decrypter::decrypt(byte *data, size_t size) { - for (; --size; ++data) - *data = ~(*data + 30); + for (size_t idx = 0; idx < size; ++idx) + *data++ = ~(*data + 30); } /*--------------------------------------------------------------------------*/ -- cgit v1.2.3