summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/pw.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-07-12 00:02:43 +0000
committerbapt <bapt@FreeBSD.org>2015-07-12 00:02:43 +0000
commitf15eb75bd08d730810d4c3e523b3c276e7d1d861 (patch)
tree64c74c2aec85952910e00ad57c345106e0e4312c /usr.sbin/pw/pw.c
parent2f9218d54244570b553e9ad09617607cb18f7381 (diff)
downloadFreeBSD-src-f15eb75bd08d730810d4c3e523b3c276e7d1d861.zip
FreeBSD-src-f15eb75bd08d730810d4c3e523b3c276e7d1d861.tar.gz
Make getarg return NULL if args is NULL
Diffstat (limited to 'usr.sbin/pw/pw.c')
-rw-r--r--usr.sbin/pw/pw.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c
index 3d4fcf2..532d77b 100644
--- a/usr.sbin/pw/pw.c
+++ b/usr.sbin/pw/pw.c
@@ -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);
OpenPOWER on IntegriCloud