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 | dda50e62a030ac93fd85476aa0e75f27fa9c47eb (patch) | |
tree | 997b3e306011ecb9a3081d6e6c402951c3c4421d /pw/pw.c | |
parent | fbab7d3255ef972d79ee2480df4dc928fd58d6e6 (diff) | |
download | pw-darwin-dda50e62a030ac93fd85476aa0e75f27fa9c47eb.tar.gz pw-darwin-dda50e62a030ac93fd85476aa0e75f27fa9c47eb.tar.zst pw-darwin-dda50e62a030ac93fd85476aa0e75f27fa9c47eb.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); |