Use MAX_KEYMAP_NUM instead of a magic value

This commit is contained in:
Eric Tang
2017-08-09 09:54:58 -07:00
parent 1c91a7d5d9
commit 71b43b8625

View File

@@ -44,7 +44,7 @@ parser_error_t ParseConfig(config_buffer_t *buffer)
}
}
keymapCount = readCompactLength(buffer);
if (keymapCount > 255) {
if (keymapCount > MAX_KEYMAP_NUM) {
return ParserError_InvalidKeymapCount;
}
for (uint8_t keymapIdx = 0; keymapIdx < keymapCount; keymapIdx++) {