Replace more strstrs

This commit is contained in:
twinaphex 2020-05-23 02:29:13 +02:00
parent d2d16ea171
commit 44a254264b
3 changed files with 7 additions and 8 deletions

View File

@ -1785,17 +1785,14 @@ int menu_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
if (!cbs)
return -1;
if (strstr(label, "joypad_index") && strstr(label, "input_player"))
if ( string_starts_with(label, "input_player") &&
string_ends_with(label, "joypad_index")
)
{
BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label);
return 0;
}
#if 0
RARCH_LOG("MENU_SETTINGS_NONE: %d\n", MENU_SETTINGS_NONE);
RARCH_LOG("MENU_SETTINGS_LAST: %d\n", MENU_SETTINGS_LAST);
#endif
if (cbs->enum_idx != MSG_UNKNOWN)
{
switch (cbs->enum_idx)

View File

@ -821,7 +821,8 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
}
}
if (strstr(label, "input_player") && strstr(label, "_joypad_index"))
if ( string_starts_with(label, "input_player") &&
string_ends_with(label, "_joypad_index"))
{
unsigned i;
for (i = 0; i < MAX_USERS; i++)

View File

@ -946,7 +946,8 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
}
}
if (strstr(label, "input_player") && strstr(label, "_joypad_index"))
if ( string_starts_with(label, "input_player") &&
string_ends_with(label, "_joypad_index"))
{
unsigned i;
for (i = 0; i < MAX_USERS; i++)