Some string cleanups

This commit is contained in:
libretroadmin 2024-12-25 19:18:45 +01:00
parent 51e706007b
commit 700b13654c
3 changed files with 6 additions and 5 deletions

View File

@ -8384,10 +8384,11 @@ unsigned menu_displaylist_build_list(
for (i = 0; i < num_cheats; i++)
{
size_t new_len = _len;
const char *cheat_description = cheat_manager_get_desc(i);
snprintf(cheat_label + _len, sizeof(cheat_label) - _len, " #%u: ", i);
new_len += snprintf(cheat_label + _len, sizeof(cheat_label) - _len, " #%u: ", i);
if (!string_is_empty(cheat_description))
strlcat(cheat_label, cheat_description, sizeof(cheat_label));
strlcpy(cheat_label + new_len, cheat_description, sizeof(cheat_label) - new_len);
/* If a search is active, skip non-matching
* entries */

View File

@ -8330,10 +8330,12 @@ static void netplay_announce(netplay_t *netplay)
buf[0] = '\0';
for (;;)
{
/* TODO/FIXME - is last param OK here */
strlcat(buf, path_basename(subsystem->elems[i].data),
sizeof(host_room->gamename));
if (++i >= subsystem->size)
break;
/* TODO/FIXME - is last param OK here */
strlcat(buf, "|", sizeof(host_room->gamename));
}

View File

@ -790,9 +790,7 @@ static int database_info_list_iterate_found_match(
entry_path_str[0] = '\0';
fill_pathname(db_playlist_base_str,
path_basename_nocompression(db_path), "", str_len);
strlcat(db_playlist_base_str, ".lpl", sizeof(db_playlist_base_str));
path_basename_nocompression(db_path), ".lpl", str_len);
if (!string_is_empty(_db->playlist_directory))
fill_pathname_join_special(db_playlist_path, _db->playlist_directory,