From: Alejandro Colomar Date: Mon, 4 Nov 2024 20:57:06 +0000 (+0100) Subject: lib/gshadow.c: build_list(): Minimize use of pointer parameters X-Git-Tag: 4.17.0-rc1~7 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3feff7ae5b740999f0994027b3fb12b9c1ae1107;p=thirdparty%2Fshadow.git lib/gshadow.c: build_list(): Minimize use of pointer parameters Use instead automatic variables as much as possible. This reduces the number of dereferences, enhancing readability. Signed-off-by: Alejandro Colomar --- diff --git a/lib/gshadow.c b/lib/gshadow.c index 87546621b..af0272261 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -40,18 +40,18 @@ build_list(char *s, char ***lp) char **l; size_t n; - *lp = NULL; + l = NULL; n = 0; while (s != NULL && *s != '\0') { - l = XREALLOC(*lp, n + 1, char *); + l = XREALLOC(l, n + 1, char *); l[n] = strsep(&s, ","); n++; - *lp = l; } - l = XREALLOC(*lp, n + 1, char *); + l = XREALLOC(l, n + 1, char *); l[n] = NULL; + *lp = l; return l;