diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 47a6c5ed18..7e8f1687fe 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -1365,7 +1365,7 @@ static void menu_action_setting_disp_set_label_playlist_associations(file_list_t const char *path, char *s2, size_t len2) { - char playlist_name_with_ext[PATH_MAX_LENGTH] = {0}; + char playlist_name_with_ext[PATH_MAX_LENGTH]; bool found_matching_core_association = false; settings_t *settings = config_get_ptr(); struct string_list *str_list = string_split(settings->playlist_names, ";"); @@ -1373,6 +1373,7 @@ static void menu_action_setting_disp_set_label_playlist_associations(file_list_t strlcpy(s2, path, len2); + playlist_name_with_ext[0] = '\0'; *s = '\0'; *w = 19; diff --git a/menu/cbs/menu_cbs_label.c b/menu/cbs/menu_cbs_label.c index 09386a4347..d0b4d656f4 100644 --- a/menu/cbs/menu_cbs_label.c +++ b/menu/cbs/menu_cbs_label.c @@ -84,7 +84,9 @@ static int action_bind_label_playlist_collection_entry( { if (strstr(path, file_path_str(FILE_PATH_LPL_EXTENSION))) { - char path_base[PATH_MAX_LENGTH] = {0}; + char path_base[PATH_MAX_LENGTH]; + path_base[0] = '\0'; + fill_short_pathname_representation_noext(path_base, path, sizeof(path_base)); diff --git a/menu/cbs/menu_cbs_title.c b/menu/cbs/menu_cbs_title.c index 5222af473b..dc295d32fc 100644 --- a/menu/cbs/menu_cbs_title.c +++ b/menu/cbs/menu_cbs_title.c @@ -37,7 +37,9 @@ static void replace_chars(char *str, char c1, char c2) static void sanitize_to_string(char *s, const char *label, size_t len) { - char new_label[PATH_MAX_LENGTH] = {0}; + char new_label[PATH_MAX_LENGTH]; + + new_label[0] = '\0'; strlcpy(new_label, label, sizeof(new_label)); strlcpy(s, new_label, len); @@ -694,7 +696,10 @@ static int action_get_title_generic(char *s, size_t len, const char *path, if (list_path) { - char elem0_path[PATH_MAX_LENGTH] = {0}; + char elem0_path[PATH_MAX_LENGTH]; + + elem0_path[0] = '\0'; + if (list_path->size > 0) strlcpy(elem0_path, list_path->elems[0].data, sizeof(elem0_path)); string_list_free(list_path); @@ -840,10 +845,12 @@ static int action_get_title_group_settings(const char *path, const char *label, strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_HORIZONTAL_MENU), len); else { - char elem0[PATH_MAX_LENGTH] = {0}; - char elem1[PATH_MAX_LENGTH] = {0}; + char elem0[PATH_MAX_LENGTH]; + char elem1[PATH_MAX_LENGTH]; struct string_list *list_label = string_split(label, "|"); + elem0[0] = elem1[0] = '\0'; + if (list_label) { if (list_label->size > 0)