mirror of
https://github.com/libretro/RetroArch
synced 2025-02-05 06:40:07 +00:00
Turn into char pointer array
This commit is contained in:
parent
b79f95668b
commit
fcf6228dce
@ -2364,7 +2364,10 @@ void input_config_parse_joy_axis(void *data, const char *prefix,
|
||||
|
||||
if (config_get_string(conf, key_label, &tmp_a))
|
||||
{
|
||||
strlcpy(bind->joyaxis_label, tmp_a, sizeof(bind->joyaxis_label));
|
||||
if (bind->joyaxis_label &&
|
||||
!string_is_empty(bind->joyaxis_label))
|
||||
free(bind->joyaxis_label);
|
||||
bind->joyaxis_label = strdup(tmp_a);
|
||||
free(tmp_a);
|
||||
}
|
||||
}
|
||||
@ -2423,7 +2426,8 @@ static void input_config_get_bind_string_joyaxis(char *buf, const char *prefix,
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!string_is_empty(bind->joyaxis_label)
|
||||
if (bind->joyaxis_label &&
|
||||
!string_is_empty(bind->joyaxis_label)
|
||||
&& settings->bools.input_descriptor_label_show)
|
||||
snprintf(buf, size, "%s%s (axis) ", prefix, bind->joyaxis_label);
|
||||
else
|
||||
|
@ -115,7 +115,7 @@ struct retro_keybind
|
||||
uint32_t orig_joyaxis;
|
||||
|
||||
char *joykey_label;
|
||||
char joyaxis_label[64];
|
||||
char *joyaxis_label;
|
||||
};
|
||||
|
||||
typedef struct rarch_joypad_info
|
||||
|
@ -478,8 +478,11 @@ bool input_autoconfigure_connect(
|
||||
if (input_autoconf_binds[state->idx][i].joykey_label
|
||||
&& !string_is_empty(input_autoconf_binds[state->idx][i].joykey_label))
|
||||
free(input_autoconf_binds[state->idx][i].joykey_label);
|
||||
input_autoconf_binds[state->idx][i].joykey_label = NULL;
|
||||
input_autoconf_binds[state->idx][i].joyaxis_label[0] = '\0';
|
||||
if (input_autoconf_binds[state->idx][i].joyaxis_label
|
||||
&& !string_is_empty(input_autoconf_binds[state->idx][i].joyaxis_label))
|
||||
free(input_autoconf_binds[state->idx][i].joyaxis_label);
|
||||
input_autoconf_binds[state->idx][i].joykey_label = NULL;
|
||||
input_autoconf_binds[state->idx][i].joyaxis_label = NULL;
|
||||
}
|
||||
|
||||
input_autoconfigured[state->idx] = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user