diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index 930620501a..0df7d7a701 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -587,6 +587,15 @@ void fill_pathname_join(char *out_path, retro_assert(strlcat(out_path, path, size) < size); } +void fill_pathname_join_concat(char *out_path, + const char *dir, const char *path, + const char *concat, + size_t size) +{ + fill_pathname_join(out_path, dir, path, size); + strlcat(out_path, concat, size); +} + void fill_pathname_join_noext(char *out_path, const char *dir, const char *path, size_t size) { diff --git a/libretro-common/include/file/file_path.h b/libretro-common/include/file/file_path.h index 8d4696c87d..8dfe333af2 100644 --- a/libretro-common/include/file/file_path.h +++ b/libretro-common/include/file/file_path.h @@ -310,6 +310,11 @@ void fill_pathname_resolve_relative(char *out_path, const char *in_refpath, void fill_pathname_join(char *out_path, const char *dir, const char *path, size_t size); +void fill_pathname_join_concat(char *out_path, + const char *dir, const char *path, + const char *concat, + size_t size); + void fill_pathname_join_noext(char *out_path, const char *dir, const char *path, size_t size); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index c6c53980a2..9ae2f56a06 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1359,13 +1359,13 @@ static void xmb_context_reset_horizontal_list( fill_pathname_application_special(iconpath, sizeof(iconpath), APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS); - fill_pathname_join(texturepath, iconpath, sysname, + fill_pathname_join_concat(texturepath, iconpath, sysname, + ".png", sizeof(texturepath)); - strlcat(texturepath, ".png", sizeof(texturepath)); - fill_pathname_join(content_texturepath, iconpath, - sysname, sizeof(content_texturepath)); - strlcat(content_texturepath, "-content.png", + fill_pathname_join_concat(content_texturepath, iconpath, + sysname, + "-content.png", sizeof(content_texturepath)); image_texture_load(&ti, texturepath);