fix coverity warnings

This commit is contained in:
radius 2018-04-19 10:07:59 -05:00
parent 8198e5c0b2
commit d8b5fea374
2 changed files with 2 additions and 4 deletions

View File

@ -403,7 +403,7 @@ static int action_left_input_desc_kbd(unsigned type, const char *label,
if (key_id > 0)
key_id--;
else
key_id = RARCH_MAX_KEYS + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
key_id = (RARCH_MAX_KEYS - 1) + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
settings->uints.input_keymapper_ids[offset][id] = key_descriptors[key_id].key;

View File

@ -126,9 +126,7 @@ int action_right_input_desc_kbd(unsigned type, const char *label,
break;
}
RARCH_LOG("o:%u t:%u i:%u r:%u\n", offset, type, id, remap_id);
if (key_id < RARCH_MAX_KEYS + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN)
if (key_id < (RARCH_MAX_KEYS - 1) + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN)
key_id++;
else
key_id = 0;