Avoid calling strlcpy when copying string onto itself (#17031)

This commit is contained in:
Eric Warmenhoven 2024-09-24 20:24:46 -04:00 committed by GitHub
parent c90f7aba6c
commit 10a1154b06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -3033,6 +3033,7 @@ bool video_shader_apply_shader(
configuration_set_bool(settings, settings->bools.video_shader_enable, true);
if (!string_is_empty(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