From: markus schnalke Date: Wed, 21 Mar 2012 19:43:27 +0000 (+0100) Subject: Minor refactoring. X-Git-Tag: mmh-thesis-end~266 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=75a3bc56e890a9ca5e25f194acbb574e942de5c5;p=mmh Minor refactoring. --- 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;