use while not for match special key map

This commit is contained in:
vcaesar 2020-01-20 09:17:03 -04:00
parent cbf92c2601
commit d087d797f0

View File

@ -115,14 +115,13 @@ MMKeyCode keyCodeForChar(const char c){
/* Some special keys are apparently not handled properly by /* Some special keys are apparently not handled properly by
* XStringToKeysym() on some systems, so search for them instead in our * XStringToKeysym() on some systems, so search for them instead in our
* mapping table. */ * mapping table. */
size_t i; struct XSpecialCharacterMapping* xs = XSpecialCharacterTable;
const size_t specialCharacterCount = while (xs->name) {
sizeof(XSpecialCharacterTable) / sizeof(XSpecialCharacterTable[0]); if (c == xs->name ) {
for (i = 0; i < specialCharacterCount; ++i) { code = xs->code;
if (c == XSpecialCharacterTable[i].name) {
code = XSpecialCharacterTable[i].code;
break; break;
} }
xs++;
} }
} }