From 071f86b73837bf706161a9f39c3b7fb339a4810d Mon Sep 17 00:00:00 2001 From: zoltanvb Date: Mon, 6 Jan 2025 08:04:36 +0100 Subject: [PATCH] Fix savestate auto-index detection Due to length confusion, state 0 would always be detected. --- 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. */