From: Guus Sliepen Date: Tue, 21 Dec 2010 14:54:10 +0000 (+0100) Subject: Fix reading past end of array containing the record of keypresses. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=82c36273f6b9ac597e283b67f15407ccf41f221e;p=quix0rs-blobwars.git Fix reading past end of array containing the record of keypresses. Found by cppcheck. --- diff --git a/src/CEngine.cpp b/src/CEngine.cpp index 0217527..9ab2581 100644 --- a/src/CEngine.cpp +++ b/src/CEngine.cpp @@ -145,7 +145,7 @@ void Engine::addKeyEvent() if (index == -1) { - for (int i = 0 ; i < 25 ; i++) + for (int i = 0 ; i < 24 ; i++) { lastKeyEvents[i] = lastKeyEvents[i + 1]; }