From 08ae38e394c3de580591092894d7aba03c839b8e Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 15 Jan 2024 19:03:07 +0100 Subject: [PATCH] lib/list.c: is_on_list(): Remove unnecessary use of temporary variable Signed-off-by: Alejandro Colomar --- lib/list.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/list.c b/lib/list.c index 73c5c4d4..d2513032 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;