]> git.mxchange.org Git - quix0rs-blobwars.git/commitdiff
Perform a sanity check when loading keyboard.cfg.
authorGuus Sliepen <guus@debian.org>
Tue, 22 Dec 2009 18:37:37 +0000 (19:37 +0100)
committerGuus Sliepen <guus@debian.org>
Tue, 22 Dec 2009 18:37:37 +0000 (19:37 +0100)
src/CConfig.cpp

index 5507f0ff35ee9f2c27032060110190597bce70e9..aea5dc36e92facdf4c52a876c409c53cf3aee269 100644 (file)
@@ -152,6 +152,15 @@ bool Config::loadKeyConfig()
                fclose(fp);\r
                return false;\r
        }\r
+\r
+       for (int i = 0; i < CONTROL::MAX; i++)\r
+       {\r
+               if (keyboard.control[i] < 0 || keyboard.control[i] >= 350)\r
+               {\r
+                       fclose(fp);\r
+                       return false;\r
+               }\r
+       }\r
                \r
        fclose(fp);\r
        \r