]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/list.c: is_on_list(): Remove unnecessary use of temporary variable
authorAlejandro Colomar <alx@kernel.org>
Mon, 15 Jan 2024 18:03:07 +0000 (19:03 +0100)
committerSerge Hallyn <serge@hallyn.com>
Thu, 14 Mar 2024 22:11:36 +0000 (17:11 -0500)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/list.c

index 73c5c4d47b65b5cc48655f1227ae76b793b5d05c..d2513032162fa355f50436c3a760b6a15b991145 100644 (file)
@@ -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;