Fix SwitchKeymapByAbbreviation() and use it in place of a for block of equivalent functionality within UsbCommand_ApplyConfig()
This commit is contained in:
@@ -28,9 +28,9 @@ void SwitchKeymapById(uint8_t index)
|
||||
|
||||
bool SwitchKeymapByAbbreviation(uint8_t length, char *abbrev)
|
||||
{
|
||||
for (uint8_t i=0; i<MAX_KEYMAP_NUM; i++) {
|
||||
for (uint8_t i=0; i<AllKeymapsCount; i++) {
|
||||
keymap_reference_t *keymap = AllKeymaps + i;
|
||||
if (keymap->abbreviationLen == length && strcmp(keymap->abbreviation, abbrev) == 0) {
|
||||
if (keymap->abbreviationLen == length && memcmp(keymap->abbreviation, abbrev, length) == 0) {
|
||||
SwitchKeymapById(i);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user