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:
committed by
Serge Hallyn
parent
46fd68c37e
commit
fce1d88479
+2
-6
@@ -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;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user