fix offset, add a couple comments

This commit is contained in:
radius 2017-09-20 22:50:28 -05:00
parent f58329d921
commit bb7243a412
2 changed files with 4 additions and 1 deletions

View File

@ -130,7 +130,9 @@ static int action_scan_input_desc(const char *path,
unsigned char player_no_str = atoi(&label[1]);
inp_desc_user = (unsigned)(player_no_str - 1);
key = (unsigned)(idx - 6);
/* This hardcoded value may cause issues if any entries are added on
top of the input binds */
key = (unsigned)(idx - 7);
}
else
key = input_config_translate_str_to_bind_id(label);

View File

@ -372,6 +372,7 @@ static int action_bind_sublabel_netplay_room(
const char *label, const char *path,
char *s, size_t len)
{
/* This offset may cause issues if any entries are added to this menu */
unsigned offset = i - 3;
if (i < 1 || offset > (unsigned)netplay_room_count)