mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
We already check if descriptor is empty beforehand
This commit is contained in:
parent
a39532f19d
commit
66ea402de8
@ -803,7 +803,6 @@ static void menu_action_setting_disp_set_label_input_desc(
|
|||||||
{
|
{
|
||||||
unsigned remap_idx;
|
unsigned remap_idx;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
const char* descriptor = NULL;
|
|
||||||
unsigned user_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) / (RARCH_FIRST_CUSTOM_BIND + 8);
|
unsigned user_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) / (RARCH_FIRST_CUSTOM_BIND + 8);
|
||||||
unsigned btn_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) - (RARCH_FIRST_CUSTOM_BIND + 8) * user_idx;
|
unsigned btn_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) - (RARCH_FIRST_CUSTOM_BIND + 8) * user_idx;
|
||||||
|
|
||||||
@ -817,14 +816,14 @@ static void menu_action_setting_disp_set_label_input_desc(
|
|||||||
RARCH_UNMAPPED)
|
RARCH_UNMAPPED)
|
||||||
{
|
{
|
||||||
unsigned mapped_port = settings->uints.input_remap_ports[user_idx];
|
unsigned mapped_port = settings->uints.input_remap_ports[user_idx];
|
||||||
descriptor = runloop_state_get_ptr()->system.input_desc_btn[mapped_port][remap_idx];
|
const char *descriptor = runloop_state_get_ptr()->system.input_desc_btn[mapped_port][remap_idx];
|
||||||
if (!string_is_empty(descriptor))
|
if (!string_is_empty(descriptor))
|
||||||
{
|
{
|
||||||
if (remap_idx < RARCH_FIRST_CUSTOM_BIND)
|
if (remap_idx < RARCH_FIRST_CUSTOM_BIND)
|
||||||
strlcpy(s, descriptor, len);
|
strlcpy(s, descriptor, len);
|
||||||
else if (!string_is_empty(descriptor) && remap_idx % 2 == 0)
|
else if (remap_idx % 2 == 0)
|
||||||
snprintf(s, len, "%s %c", descriptor, '+');
|
snprintf(s, len, "%s %c", descriptor, '+');
|
||||||
else if (remap_idx % 2 != 0)
|
else
|
||||||
snprintf(s, len, "%s %c", descriptor, '-');
|
snprintf(s, len, "%s %c", descriptor, '-');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user