Skip to content

Commit

Permalink
Avoid calling strlcpy when copying string onto itself (#17031)
Browse files Browse the repository at this point in the history
  • Loading branch information
warmenhoven authored Sep 25, 2024
1 parent c90f7ab commit 10a1154
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gfx/video_shader_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3033,8 +3033,9 @@ bool video_shader_apply_shader(
configuration_set_bool(settings, settings->bools.video_shader_enable, true);
if (!string_is_empty(preset_path))
{
strlcpy(runloop_st->runtime_shader_preset_path, preset_path,
sizeof(runloop_st->runtime_shader_preset_path));
if (runloop_st->runtime_shader_preset_path != preset_path)
strlcpy(runloop_st->runtime_shader_preset_path, preset_path,
sizeof(runloop_st->runtime_shader_preset_path));
#ifdef HAVE_MENU
/* reflect in shader manager */
if (menu_shader_manager_set_preset(
Expand Down

0 comments on commit 10a1154

Please sign in to comment.