diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-07-12 00:02:43 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-07-12 00:02:43 +0000 |
commit | 5c8793faf0c3ceee6ca534d0f69b417a3759f7af (patch) | |
tree | cba1ad072930f098dd9524c5359a684cf0afbeb4 /pw/pw.c | |
parent | 53d815d2b67ba1daf3d088e6049c75e9134228d2 (diff) | |
download | pw-darwin-5c8793faf0c3ceee6ca534d0f69b417a3759f7af.tar.gz pw-darwin-5c8793faf0c3ceee6ca534d0f69b417a3759f7af.tar.zst pw-darwin-5c8793faf0c3ceee6ca534d0f69b417a3759f7af.zip |
Make getarg return NULL if args is NULL
Diffstat (limited to 'pw/pw.c')
-rw-r--r-- | pw/pw.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); |