diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index a291ee547f8..8173eedc488 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -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)