From: Alejandro Colomar Date: Tue, 5 Nov 2024 14:13:35 +0000 (+0100) Subject: lib/gshadow.c: build_list(): Remove second parameter X-Git-Tag: 4.17.0-rc1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ba62265b3c9532d4901963582924c178d702045;p=thirdparty%2Fshadow.git lib/gshadow.c: build_list(): Remove second parameter 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 --- diff --git a/lib/gshadow.c b/lib/gshadow.c index bd9388995..1cd4566e1 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -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; }