From: Alejandro Colomar Date: Mon, 15 Jan 2024 18:07:28 +0000 (+0100) Subject: lib/list.c: is_on_list(): Call strsep(3) instead of open-coding it X-Git-Tag: 4.15.1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fce1d884795f311c1024915fc4a9161e141fcebd;p=thirdparty%2Fshadow.git lib/list.c: is_on_list(): Call strsep(3) instead of open-coding it Signed-off-by: Alejandro Colomar --- diff --git a/lib/list.c b/lib/list.c index 28f530685..9fc660895 100644 --- a/lib/list.c +++ b/lib/list.c @@ -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; /*