mirror of
https://github.com/libretro/RetroArch
synced 2024-07-03 00:38:44 +00:00
Replace some strlcat usage with strlcpy
This commit is contained in:
parent
3736aa963f
commit
37bcb4f093
|
@ -4902,7 +4902,7 @@ static void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||||
|
|
||||||
if (string_ends_with_size(path, ".lpl", strlen(path), STRLEN_CONST(".lpl")))
|
if (string_ends_with_size(path, ".lpl", strlen(path), STRLEN_CONST(".lpl")))
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len, syslen;
|
||||||
struct texture_image ti;
|
struct texture_image ti;
|
||||||
char sysname[PATH_MAX_LENGTH];
|
char sysname[PATH_MAX_LENGTH];
|
||||||
char texturepath[PATH_MAX_LENGTH];
|
char texturepath[PATH_MAX_LENGTH];
|
||||||
|
@ -4911,14 +4911,14 @@ static void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||||
/* Add current node to playlist database name map */
|
/* Add current node to playlist database name map */
|
||||||
RHMAP_SET_STR(ozone->playlist_db_node_map, path, node);
|
RHMAP_SET_STR(ozone->playlist_db_node_map, path, node);
|
||||||
|
|
||||||
len = fill_pathname_base(
|
syslen = fill_pathname_base(sysname, path, sizeof(sysname));
|
||||||
sysname, path, sizeof(sysname));
|
|
||||||
/* Manually strip the extension (and dot) from sysname */
|
/* Manually strip the extension (and dot) from sysname */
|
||||||
sysname[len-4] =
|
sysname[syslen-4] =
|
||||||
sysname[len-3] =
|
sysname[syslen-3] =
|
||||||
sysname[len-2] =
|
sysname[syslen-2] =
|
||||||
sysname[len-1] = '\0';
|
sysname[syslen-1] = '\0';
|
||||||
len = fill_pathname_join_special(texturepath,
|
syslen -= 4;
|
||||||
|
len = fill_pathname_join_special(texturepath,
|
||||||
ozone->icons_path, sysname,
|
ozone->icons_path, sysname,
|
||||||
sizeof(texturepath));
|
sizeof(texturepath));
|
||||||
texturepath[ len] = '.';
|
texturepath[ len] = '.';
|
||||||
|
@ -4957,7 +4957,7 @@ static void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||||
image_texture_free(&ti);
|
image_texture_free(&ti);
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcat(sysname, "-content.png", sizeof(sysname));
|
strlcpy(sysname + syslen, "-content.png", sizeof(sysname) - syslen);
|
||||||
/* Assemble new icon path */
|
/* Assemble new icon path */
|
||||||
fill_pathname_join_special(
|
fill_pathname_join_special(
|
||||||
content_texturepath, ozone->icons_path, sysname,
|
content_texturepath, ozone->icons_path, sysname,
|
||||||
|
|
|
@ -2457,7 +2457,7 @@ static void xmb_context_reset_horizontal_list(xmb_handle_t *xmb)
|
||||||
|
|
||||||
if (string_ends_with_size(path, ".lpl", strlen(path), STRLEN_CONST(".lpl")))
|
if (string_ends_with_size(path, ".lpl", strlen(path), STRLEN_CONST(".lpl")))
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len, syslen;
|
||||||
struct texture_image ti;
|
struct texture_image ti;
|
||||||
char sysname[PATH_MAX_LENGTH];
|
char sysname[PATH_MAX_LENGTH];
|
||||||
char texturepath[PATH_MAX_LENGTH];
|
char texturepath[PATH_MAX_LENGTH];
|
||||||
|
@ -2467,13 +2467,13 @@ static void xmb_context_reset_horizontal_list(xmb_handle_t *xmb)
|
||||||
/* Add current node to playlist database name map */
|
/* Add current node to playlist database name map */
|
||||||
RHMAP_SET_STR(xmb->playlist_db_node_map, path, node);
|
RHMAP_SET_STR(xmb->playlist_db_node_map, path, node);
|
||||||
|
|
||||||
len = fill_pathname_base(sysname, path, sizeof(sysname));
|
syslen = fill_pathname_base(sysname, path, sizeof(sysname));
|
||||||
/* Manually strip the extension (and dot) from sysname */
|
/* Manually strip the extension (and dot) from sysname */
|
||||||
sysname[len-4] =
|
sysname[syslen-4] =
|
||||||
sysname[len-3] =
|
sysname[syslen-3] =
|
||||||
sysname[len-2] =
|
sysname[syslen-2] =
|
||||||
sysname[len-1] = '\0';
|
sysname[syslen-1] = '\0';
|
||||||
|
syslen -= 4;
|
||||||
len = fill_pathname_join_special(texturepath, iconpath, sysname,
|
len = fill_pathname_join_special(texturepath, iconpath, sysname,
|
||||||
sizeof(texturepath));
|
sizeof(texturepath));
|
||||||
texturepath[ len] = '.';
|
texturepath[ len] = '.';
|
||||||
|
@ -2510,7 +2510,7 @@ static void xmb_context_reset_horizontal_list(xmb_handle_t *xmb)
|
||||||
image_texture_free(&ti);
|
image_texture_free(&ti);
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcat(sysname, "-content.png", sizeof(sysname));
|
strlcpy(sysname + syslen, "-content.png", sizeof(sysname) - syslen);
|
||||||
/* Assemble new icon path */
|
/* Assemble new icon path */
|
||||||
fill_pathname_join_special(content_texturepath, iconpath, sysname,
|
fill_pathname_join_special(content_texturepath, iconpath, sysname,
|
||||||
sizeof(content_texturepath));
|
sizeof(content_texturepath));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user