From: Alejandro Colomar Date: Mon, 15 Jan 2024 18:03:07 +0000 (+0100) Subject: lib/list.c: is_on_list(): Remove unnecessary use of temporary variable X-Git-Tag: 4.15.1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08ae38e394c3de580591092894d7aba03c839b8e;p=thirdparty%2Fshadow.git lib/list.c: is_on_list(): Remove unnecessary use of temporary variable Signed-off-by: Alejandro Colomar --- diff --git a/lib/list.c b/lib/list.c index 73c5c4d47..d25130321 100644 --- a/lib/list.c +++ b/lib/list.c @@ -234,11 +234,9 @@ bool is_on_list (char *const *list, const char *member) for (cp = members, i = 0;; i++) { array[i] = cp; - cp2 = strchr (cp, ','); - if (NULL != cp2) { - *cp2 = '\0'; - cp2++; - cp = cp2; + cp = strchr(cp, ','); + if (NULL != cp) { + *cp++ = '\0'; } else { array[i + 1] = NULL; break;