Fix savestate thumbnails - '.png' needs to be appended to the total

filepath, so fill_pathname can't be used since it would overwrite
the existing extension
This commit is contained in:
LibretroAdmin 2024-12-30 23:39:36 +01:00
parent 3a4330238a
commit 33ec89306e

View File

@ -307,8 +307,13 @@ static bool screenshot_dump(
if (!fullpath)
{
if (savestate)
fill_pathname(state->filename,
name_base, ".png", sizeof(state->filename));
{
size_t _len = strlcpy(state->filename,
name_base, sizeof(state->filename));
strlcpy(state->filename + _len,
".png",
sizeof(state->filename) - _len);
}
else
{
char new_screenshot_dir[DIR_MAX_LENGTH];
@ -361,9 +366,14 @@ static bool screenshot_dump(
IMG_EXT, sizeof(state->shotname));
}
else
fill_pathname(state->shotname,
path_basename_nocompression(name_base),
".png", sizeof(state->shotname));
{
size_t _len = strlcpy(state->shotname,
path_basename_nocompression(name_base),
sizeof(state->shotname));
strlcpy(state->shotname + _len,
".png",
sizeof(state->shotname) - _len);
}
if ( string_is_empty(new_screenshot_dir)
|| settings->bools.screenshots_in_content_dir)