From: Guus Sliepen Date: Tue, 22 Dec 2009 18:37:37 +0000 (+0100) Subject: Perform a sanity check when loading keyboard.cfg. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=96be705631b4ed8a6bc98c8d2c0f1fc73e4a0807;p=quix0rs-blobwars.git Perform a sanity check when loading keyboard.cfg. --- diff --git a/src/CConfig.cpp b/src/CConfig.cpp index 5507f0f..aea5dc3 100644 --- a/src/CConfig.cpp +++ b/src/CConfig.cpp @@ -152,6 +152,15 @@ bool Config::loadKeyConfig() fclose(fp); return false; } + + for (int i = 0; i < CONTROL::MAX; i++) + { + if (keyboard.control[i] < 0 || keyboard.control[i] >= 350) + { + fclose(fp); + return false; + } + } fclose(fp);