From 5ba62265b3c9532d4901963582924c178d702045 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 5 Nov 2024 15:13:35 +0100 Subject: [PATCH] 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 --- lib/gshadow.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/gshadow.c b/lib/gshadow.c index bd938899..1cd4566e 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; }