From 75a3bc56e890a9ca5e25f194acbb574e942de5c5 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Wed, 21 Mar 2012 20:43:27 +0100 Subject: [PATCH] Minor refactoring. --- uip/aliasbr.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/uip/aliasbr.c b/uip/aliasbr.c index 7b7bcef..baeab6f 100644 --- a/uip/aliasbr.c +++ b/uip/aliasbr.c @@ -360,8 +360,8 @@ addgroup(struct aka *ak, char *grp) } #ifdef DBMPWD if ((pw = getpwnam(gp))) { - hmalloc(pw); - add_aka(ak, gp); + hmalloc(pw); + add_aka(ak, gp); } } #endif /* DBMPWD */ @@ -516,10 +516,11 @@ hmalloc(struct passwd *pw) p->h_shell = getcpy(pw->pw_shell); p->h_ngrps = 0; p->h_next = NULL; - if (hometail != NULL) - hometail->h_next = p; - if (homehead == NULL) + /* append to end */ + if (!homehead) homehead = p; + if (hometail) + hometail->h_next = p; hometail = p; return p; -- 1.7.10.4