From 5399faaa9d6e625fd462cb92d7d203c88df2cd10 Mon Sep 17 00:00:00 2001 From: zoltanvb <101990835+zoltanvb@users.noreply.github.com> Date: Mon, 6 Jan 2025 11:45:00 +0100 Subject: [PATCH] Fix savestate auto-index detection (#17351) --- command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command.c b/command.c index 1f33a6a0087..8dfe80e471d 100644 --- a/command.c +++ b/command.c @@ -1460,7 +1460,8 @@ static void scan_states(settings_t *settings, if (string_is_empty(dir_elem)) continue; - _len = fill_pathname_base(elem_base, dir_elem, sizeof(elem_base)); + _len = strlen(dir_elem); + fill_pathname_base(elem_base, dir_elem, sizeof(elem_base)); /* Only consider files with a '.state' extension * > i.e. Ignore '.state.auto', '.state.bak', etc. */