lib/list.c: is_on_list(): Move code out of loop

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-03-14 17:11:36 -05:00
committed by Serge Hallyn
parent 08ae38e394
commit fb01e07e83
+3 -4
View File
@@ -235,13 +235,12 @@ bool is_on_list (char *const *list, const char *member)
for (cp = members, i = 0;; i++) {
array[i] = cp;
cp = strchr(cp, ',');
if (NULL != cp) {
if (NULL != cp)
*cp++ = '\0';
} else {
array[i + 1] = NULL;
else
break;
}
}
array[i+1] = NULL;
/*
* Return the new array of pointers