From dc3271b705a44a851d94f5fc5088249e8291fa57 Mon Sep 17 00:00:00 2001 From: yexo Date: Sun, 1 Aug 2010 10:42:18 +0000 Subject: [PATCH] (svn r20274) -Fix: special keycodes were matched if a code matched the start of the string (ie 'C' matched 'CTRL') --- src/hotkeys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index e9c14544f9..2dbad3ce9f 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -70,7 +70,7 @@ static uint16 ParseCode(const char *start, const char *end) while (start < end && *start == ' ') start++; while (end > start && *end == ' ') end--; for (uint i = 0; i < lengthof(_keycode_to_name); i++) { - if (strncasecmp(start, _keycode_to_name[i].name, end - start) == 0) { + if (strlen(_keycode_to_name[i].name) == end - start && strncasecmp(start, _keycode_to_name[i].name, end - start) == 0) { return _keycode_to_name[i].keycode; } }