]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/gshadow.c: build_list(): Remove second parameter
authorAlejandro Colomar <alx@kernel.org>
Tue, 5 Nov 2024 14:13:35 +0000 (15:13 +0100)
committerSerge Hallyn <serge@hallyn.com>
Fri, 6 Dec 2024 03:20:59 +0000 (21:20 -0600)
We've simplified the function so much in the previous commits, that now
$2 is rather useless.  It only sets the output parameter to the same
value that the function returns.  It's simpler if the caller just sets
it itself after the call.

This removes the only 3-star pointer in the entire project.  :)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/gshadow.c

index bd938899514a017b7d5c2c2cc3b9588619f2831b..1cd4566e1c3c8c712e58e2bf25e8469f27f55ec2 100644 (file)
@@ -36,7 +36,7 @@ static struct sgrp sgroup;
 
 
 static /*@null@*/char **
-build_list(char *s, char ***lp)
+build_list(char *s)
 {
        char    **l;
        size_t  n;
@@ -52,8 +52,6 @@ build_list(char *s, char ***lp)
        l = XREALLOC(l, n + 1, char *);
        l[n] = NULL;
 
-       *lp = l;
-
        return l;
 }
 
@@ -120,8 +118,8 @@ sgetsgent(const char *string)
        free (admins);
        free (members);
 
-       sgroup.sg_adm = build_list(fields[2], &admins);
-       sgroup.sg_mem = build_list(fields[3], &members);
+       sgroup.sg_adm = admins  = build_list(fields[2]);
+       sgroup.sg_mem = members = build_list(fields[3]);
 
        return &sgroup;
 }