Get rid of some implicit memsets in menu/cbs

This commit is contained in:
twinaphex 2016-10-08 19:16:25 +02:00
parent 6b48c6ee7f
commit ec243713bd
2 changed files with 14 additions and 8 deletions

View File

@ -325,12 +325,12 @@ static int playlist_association_left(unsigned type, const char *label,
bool wraparound)
{
unsigned i;
int next, found, current = 0;
char core_path[PATH_MAX_LENGTH];
char new_playlist_cores[PATH_MAX_LENGTH];
int next, found, current = 0;
core_info_t *info = NULL;
struct string_list *stnames = NULL;
struct string_list *stcores = NULL;
char core_path[PATH_MAX_LENGTH] = {0};
char new_playlist_cores[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr();
const char *path = path_basename(label);
core_info_list_t *list = NULL;
@ -340,6 +340,8 @@ static int playlist_association_left(unsigned type, const char *label,
if (!list)
return menu_cbs_exit();
core_path[0] = new_playlist_cores[0] = '\0';
stnames = string_split(settings->playlist_names, ";");
stcores = string_split(settings->playlist_cores, ";");
@ -425,7 +427,9 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
for (i = 0; i < MAX_USERS; i++)
{
uint32_t label_setting_hash;
char label_setting[PATH_MAX_LENGTH] = {0};
char label_setting[PATH_MAX_LENGTH];
label_setting[0] = '\0';
snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1);
label_setting_hash = msg_hash_calculate(label_setting);

View File

@ -338,20 +338,22 @@ static int action_right_video_resolution(unsigned type, const char *label,
static int playlist_association_right(unsigned type, const char *label,
bool wraparound)
{
size_t i, next, found, current = 0;
char core_path[PATH_MAX_LENGTH] = {0};
char core_path[PATH_MAX_LENGTH];
char new_playlist_cores[PATH_MAX_LENGTH];
size_t i, next, found, current = 0;
core_info_t *info = NULL;
struct string_list *stnames = NULL;
struct string_list *stcores = NULL;
char new_playlist_cores[PATH_MAX_LENGTH] = {0};
core_info_list_t *list = NULL;
settings_t *settings = config_get_ptr();
const char *path = path_basename(label);
core_info_list_t *list = NULL;
core_info_get_list(&list);
if (!list)
return menu_cbs_exit();
core_path[0] = new_playlist_cores[0] = '\0';
stnames = string_split(settings->playlist_names, ";");
stcores = string_split(settings->playlist_cores, ";");