From c4132a81d876d6414dee73ca94eb02aeff35ac14 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 9 Mar 2012 18:03:56 +0300 Subject: Validate reading keys from config. --- src/keyboardconfig.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index cf620148e..50bdaf295 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -397,6 +397,9 @@ void KeyboardConfig::retrieve() { mKey[i].value = static_cast(config.getValue( mKey[i].configField, mKey[i].defaultValue)); + logger->log("key: %d", mKey[i].value); + if (mKey[i].value < -255 || mKey[i].value > SDLK_LAST) + mKey[i].value = KEY_NO_VALUE; } } } -- cgit v1.2.3-70-g09d2