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 <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
c1d597acbb
commit
5ba62265b3
+3
-5
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user