summaryrefslogtreecommitdiffstats
path: root/pw/pw.c
diff options
context:
space:
mode:
Diffstat (limited to 'pw/pw.c')
-rw-r--r--pw/pw.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pw/pw.c b/pw/pw.c
index 3d4fcf2..532d77b 100644
--- a/pw/pw.c
+++ b/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);