Use instead automatic variables as much as possible.
This reduces the number of dereferences, enhancing readability.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
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;