mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Replace some more strlcat calls
This commit is contained in:
parent
bd090dea71
commit
4b6bd83780
@ -328,7 +328,7 @@ bool path_is_compressed_file(const char* path)
|
||||
size_t fill_pathname(char *out_path, const char *in_path,
|
||||
const char *replace, size_t size)
|
||||
{
|
||||
size_t _len, _len2;
|
||||
size_t _len;
|
||||
char tmp_path[PATH_MAX_LENGTH];
|
||||
char *tok = NULL;
|
||||
strlcpy(tmp_path, in_path, sizeof(tmp_path));
|
||||
@ -336,8 +336,8 @@ size_t fill_pathname(char *out_path, const char *in_path,
|
||||
*tok = '\0';
|
||||
|
||||
_len = strlcpy(out_path, tmp_path, size);
|
||||
_len2 = strlcpy(out_path + _len, replace, size - _len);
|
||||
return _len + _len2;
|
||||
_len += strlcpy(out_path + _len, replace, size - _len);
|
||||
return _len;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2252,6 +2252,7 @@ static int menu_displaylist_parse_playlist(
|
||||
|
||||
if (!string_is_empty(entry->path))
|
||||
{
|
||||
size_t _len;
|
||||
/* Standard playlist entry
|
||||
* > Base menu entry label is always playlist label
|
||||
* > If playlist label is NULL, fallback to playlist entry file name
|
||||
@ -2259,10 +2260,13 @@ static int menu_displaylist_parse_playlist(
|
||||
* no further action is necessary */
|
||||
|
||||
if (string_is_empty(entry->label))
|
||||
fill_pathname(menu_entry_label,
|
||||
path_basename(entry->path), "", sizeof(menu_entry_label));
|
||||
_len = fill_pathname(menu_entry_label,
|
||||
path_basename(entry->path), "",
|
||||
sizeof(menu_entry_label));
|
||||
else
|
||||
strlcpy(menu_entry_label, entry->label, sizeof(menu_entry_label));
|
||||
_len = strlcpy(menu_entry_label,
|
||||
entry->label,
|
||||
sizeof(menu_entry_label));
|
||||
|
||||
if (sanitization)
|
||||
(*sanitization)(menu_entry_label);
|
||||
@ -2275,8 +2279,13 @@ static int menu_displaylist_parse_playlist(
|
||||
&& !string_is_empty(entry->core_path)
|
||||
&& !string_is_equal(entry->core_path, "DETECT"))
|
||||
{
|
||||
strlcat(menu_entry_label, label_spacer, sizeof(menu_entry_label));
|
||||
strlcat(menu_entry_label, entry->core_name, sizeof(menu_entry_label));
|
||||
_len += strlcpy(
|
||||
menu_entry_label + _len,
|
||||
label_spacer,
|
||||
sizeof(menu_entry_label) - _len);
|
||||
strlcpy(menu_entry_label + _len,
|
||||
entry->core_name,
|
||||
sizeof(menu_entry_label) - _len);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user