(svn r20274) -Fix: special keycodes were matched if a code matched the start of the string (ie 'C' matched 'CTRL')

This commit is contained in:
yexo 2010-08-01 10:42:18 +00:00
parent b0b0a21617
commit dc3271b705
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}
}