mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(settings_data) Fix the leaks at 3758 and 3759; better one leak than three.
This commit is contained in:
parent
7fed404a8d
commit
4c856a2d7f
@ -3750,13 +3750,20 @@ bool setting_data_append_list_input_options(
|
|||||||
/* TODO: input_libretro_device_p%u */
|
/* TODO: input_libretro_device_p%u */
|
||||||
for (player = 0; player < MAX_PLAYERS; player ++)
|
for (player = 0; player < MAX_PLAYERS; player ++)
|
||||||
{
|
{
|
||||||
char key[PATH_MAX], label[PATH_MAX];
|
/* These constants match the string lengths.
|
||||||
snprintf(key, sizeof(key), "input_player%d_joypad_index", player + 1);
|
* Keep them up to date or you'll get some really obvious bugs.
|
||||||
snprintf(label, sizeof(label), "Player %d Pad Index", player + 1);
|
* 2 is the length of '99'; we don't need more players than that.
|
||||||
|
*/
|
||||||
|
static char key[MAX_PLAYERS][25+2+1];
|
||||||
|
static char label[MAX_PLAYERS][17+2+1];
|
||||||
|
snprintf(key[player], sizeof(key[player]),
|
||||||
|
"input_player%d_joypad_index", player + 1);
|
||||||
|
snprintf(label[player], sizeof(label[player]),
|
||||||
|
"Player %d Pad Index", player + 1);
|
||||||
CONFIG_INT(
|
CONFIG_INT(
|
||||||
g_settings.input.joypad_map[player],
|
g_settings.input.joypad_map[player],
|
||||||
strdup(key),
|
key[player],
|
||||||
strdup(label),
|
label[player],
|
||||||
0,
|
0,
|
||||||
group_info.name,
|
group_info.name,
|
||||||
subgroup_info.name,
|
subgroup_info.name,
|
||||||
@ -3832,7 +3839,10 @@ bool setting_data_append_list_input_options(
|
|||||||
|
|
||||||
for (player = 0; player < MAX_PLAYERS; player ++)
|
for (player = 0; player < MAX_PLAYERS; player ++)
|
||||||
{
|
{
|
||||||
/* 7 for "Player ", 2 for number (we shouldn't need 100), and 1 for NUL. */
|
/* This constants matches the string length.
|
||||||
|
* Keep it up to date or you'll get some really obvious bugs.
|
||||||
|
* 2 is the length of '99'; we don't need more players than that.
|
||||||
|
*/
|
||||||
static char buffer[MAX_PLAYERS][7+2+1];
|
static char buffer[MAX_PLAYERS][7+2+1];
|
||||||
const struct retro_keybind* const defaults =
|
const struct retro_keybind* const defaults =
|
||||||
(player == 0) ? retro_keybinds_1 : retro_keybinds_rest;
|
(player == 0) ? retro_keybinds_1 : retro_keybinds_rest;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user