From 3ac156422e09341f2acfba352a06c9629b6e0b20 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 17 Apr 2013 21:34:26 +0200 Subject: KYRA: (LOL) - fix warning about possible out of bounds access in lol.cpp --- engines/kyra/lol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index f7696d45b5..3af65d9b7a 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -1363,7 +1363,7 @@ void LoLEngine::setCharacterMagicOrHitPoints(int charNum, int type, int points, { 0x21, 0xAA, 0x99, 0x00, 0x4253 } }; - if (charNum > 3) + if (charNum > 2) return; LoLCharacter *c = &_characters[charNum]; @@ -1851,7 +1851,7 @@ int LoLEngine::playCharacterScriptChat(int charId, int mode, int restorePortrait } else if (charId > 0) { int i = 0; - for (; i < 4; i++) { + for (; i < 3; i++) { if (_characters[i].id != charId || !(_characters[i].flags & 1)) continue; if (charId == ch) -- cgit v1.2.3