From c1709f2218a0c2a27c40807aada4d72e76d8fdc7 Mon Sep 17 00:00:00 2001 From: LibretroAdmin Date: Tue, 13 Sep 2022 09:14:43 +0200 Subject: [PATCH] (gfx_widget_load_content_animation) Get rid of strlen --- gfx/widgets/gfx_widget_load_content_animation.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gfx/widgets/gfx_widget_load_content_animation.c b/gfx/widgets/gfx_widget_load_content_animation.c index 0606e0e47e..6453f20666 100644 --- a/gfx/widgets/gfx_widget_load_content_animation.c +++ b/gfx/widgets/gfx_widget_load_content_animation.c @@ -397,11 +397,12 @@ bool gfx_widget_start_load_content_animation(void) if (!string_is_empty(playlist_path)) { - fill_pathname_base(state->system_name, playlist_path, + char new_system_name[512]; + strlcpy(new_system_name, playlist_path, sizeof(new_system_name)); + path_remove_extension(new_system_name); + state->system_name_len = fill_pathname_base( + state->system_name, new_system_name, sizeof(state->system_name)); - path_remove_extension(state->system_name); - - state->system_name_len = strlen(state->system_name); /* Exclude history and favourites playlists */ if (string_ends_with_size(state->system_name, "_history", state->system_name_len, STRLEN_CONST("_history")) ||