Minor refactoring.
authormarkus schnalke <meillo@marmaro.de>
Wed, 21 Mar 2012 19:43:27 +0000 (20:43 +0100)
committermarkus schnalke <meillo@marmaro.de>
Wed, 21 Mar 2012 19:43:27 +0000 (20:43 +0100)
uip/aliasbr.c

index 7b7bcef..baeab6f 100644 (file)
@@ -360,8 +360,8 @@ addgroup(struct aka *ak, char *grp)
                        }
 #ifdef DBMPWD
                if ((pw = getpwnam(gp))) {
                        }
 #ifdef DBMPWD
                if ((pw = getpwnam(gp))) {
-                               hmalloc(pw);
-                               add_aka(ak, gp);
+                       hmalloc(pw);
+                       add_aka(ak, gp);
                }
        }
 #endif /* DBMPWD */
                }
        }
 #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;
        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;
                homehead = p;
+       if (hometail)
+               hometail->h_next = p;
        hometail = p;
 
        return p;
        hometail = p;
 
        return p;