lib/list.c: is_on_list(): Call strsep(3) instead of open-coding it

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 46fd68c37e
commit fce1d88479
+2 -6
View File
@@ -232,12 +232,8 @@ bool is_on_list (char *const *list, const char *member)
* array of pointers.
*/
for (cp = members, i = 0; cp != NULL; i++) {
array[i] = cp;
cp = strchr(cp, ',');
if (NULL != cp)
*cp++ = '\0';
}
for (cp = members, i = 0; cp != NULL; i++)
array[i] = strsep(&cp, ",");
array[i] = NULL;
/*