From 82c36273f6b9ac597e283b67f15407ccf41f221e Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 21 Dec 2010 15:54:10 +0100 Subject: [PATCH] Fix reading past end of array containing the record of keypresses. Found by cppcheck. --- src/CEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; } -- 2.39.5