From: notaz Date: Sun, 8 Sep 2013 18:05:28 +0000 (+0300) Subject: fix deadlock on list seek X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec90b021373a7f9dd02c593f656eddc2b36b5252;p=libpicofe.git fix deadlock on list seek --- diff --git a/menu.c b/menu.c index eb728da..2e97f06 100644 --- a/menu.c +++ b/menu.c @@ -959,9 +959,11 @@ static int dirent_seek_char(struct dirent **namelist, int len, int sel, char c) int i; sel++; - for (i = sel + 1; i != sel; i++) { + for (i = sel + 1; ; i++) { if (i >= len) i = 1; + if (i == sel) + break; if (tolower_simple(namelist[i]->d_name[0]) == c) break;