From: kub Date: Fri, 16 Sep 2022 20:06:24 +0000 (+0000) Subject: fix off-by-1 in directory listing search X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5b32cc30c98b1772cdfd4ed1ff5476dced770cc;p=libpicofe.git fix off-by-1 in directory listing search --- diff --git a/menu.c b/menu.c index 929713d..da9ddf2 100644 --- a/menu.c +++ b/menu.c @@ -981,7 +981,6 @@ static int dirent_seek_char(struct dirent **namelist, int len, int sel, char c) { int i; - sel++; for (i = sel + 1; ; i++) { if (i >= len) i = 1; @@ -992,7 +991,7 @@ static int dirent_seek_char(struct dirent **namelist, int len, int sel, char c) break; } - return i - 1; + return i; } static const char *menu_loop_romsel(char *curr_path, int len,