"ut lib,mem" only runs lib. The loop sets name to NULL after strsep(),
but strsep() has already moved it past the comma.

Loop on strsep() until it returns NULL.

Fixes: fa0b68d22add ("test: Allow running a selection of suites")
Signed-off-by: Anders Roxell <[email protected]>
---
 test/cmd_ut.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/cmd_ut.c b/test/cmd_ut.c
index 4328670d0d67..bd9905caf518 100644
--- a/test/cmd_ut.c
+++ b/test/cmd_ut.c
@@ -297,7 +297,7 @@ static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, 
char *const argv[])
                int any_fail = 0;
                const char *p;
 
-               for (; p = strsep(&name, ","), p; name = NULL) {
+               while ((p = strsep(&name, ","))) {
                        ste = find_suite(p);
                        if (!ste) {
                                printf("Suite '%s' not found\n", p);
-- 
2.53.0

Reply via email to