From: Alejandro Colomar Date: Wed, 17 Jan 2024 01:46:21 +0000 (+0100) Subject: lib/list.c: is_on_list(): Move code out of loop X-Git-Tag: 4.15.1~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb01e07e83763733a2ad825ef6fc6974b25401f9;p=thirdparty%2Fshadow.git lib/list.c: is_on_list(): Move code out of loop Signed-off-by: Alejandro Colomar --- diff --git a/lib/list.c b/lib/list.c index d25130321..b88f5c5ab 100644 --- a/lib/list.c +++ b/lib/list.c @@ -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