Date: Sun, 12 Jul 2015 00:02:44 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285415 - head/usr.sbin/pw Message-ID: <201507120002.t6C02i8i001155@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Sun Jul 12 00:02:43 2015 New Revision: 285415 URL: https://svnweb.freebsd.org/changeset/base/285415 Log: Make getarg return NULL if args is NULL Modified: head/usr.sbin/pw/pw.c head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Sat Jul 11 23:56:55 2015 (r285414) +++ head/usr.sbin/pw/pw.c Sun Jul 12 00:02:43 2015 (r285415) @@ -582,7 +582,12 @@ cmdhelp(int mode, int which) struct carg * getarg(struct cargs * _args, int ch) { - struct carg *c = LIST_FIRST(_args); + struct carg *c; + + if (_args == NULL) + return (NULL); + + c = LIST_FIRST(_args); while (c != NULL && c->ch != ch) c = LIST_NEXT(c, list); Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat Jul 11 23:56:55 2015 (r285414) +++ head/usr.sbin/pw/pw_user.c Sun Jul 12 00:02:43 2015 (r285415) @@ -874,11 +874,8 @@ pw_gidpolicy(struct cargs * args, char * (grp->gr_mem == NULL || grp->gr_mem[0] == NULL)) { gid = grp->gr_gid; /* Already created? Use it anyway... */ } else { - struct cargs grpargs; gid_t grid = -1; - LIST_INIT(&grpargs); - /* * We need to auto-create a group with the user's name. We * can send all the appropriate output to our sister routine @@ -893,7 +890,7 @@ pw_gidpolicy(struct cargs * args, char * if (conf.dryrun) { gid = pw_groupnext(cnf, true); } else { - pw_group(M_ADD, nam, grid, &grpargs); + pw_group(M_ADD, nam, grid, NULL); if ((grp = GETGRNAM(nam)) != NULL) gid = grp->gr_gid; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507120002.t6C02i8i001155>