]> git.mxchange.org Git - quix0rs-blobwars.git/commitdiff
Fix reading past end of array containing the record of keypresses.
authorGuus Sliepen <guus@debian.org>
Tue, 21 Dec 2010 14:54:10 +0000 (15:54 +0100)
committerGuus Sliepen <guus@debian.org>
Tue, 21 Dec 2010 14:54:10 +0000 (15:54 +0100)
Found by cppcheck.

src/CEngine.cpp

index 02175277e4df59843a4fd77b278d0aaa7364cd19..9ab25813c1cf10cb8ec2127b2bb5ab2d799bf531 100644 (file)
@@ -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];
                }