diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-01-15 19:07:28 +0100 |
---|---|---|
committer | Serge Hallyn <serge@hallyn.com> | 2024-03-14 17:11:36 -0500 |
commit | fce1d884795f311c1024915fc4a9161e141fcebd (patch) | |
tree | 5301b84059199bc506d7dffb79f1667a09f10bd2 | |
parent | 46fd68c37e63e7c00b922c86c8e83aea4142510a (diff) |
lib/list.c: is_on_list(): Call strsep(3) instead of open-coding it
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | lib/list.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -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; /* |