summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraaron <aaron@openbsd.org>1998-11-25 22:33:38 +0000
committeraaron <aaron@openbsd.org>1998-11-25 22:33:38 +0000
commit38a646d7021e23261b448dc8fe637aeaf7bced2c (patch)
treee0598d87d2c9aab75eb59244adb737d5b328fa6a
parentfix comment (diff)
downloadwireguard-openbsd-38a646d7021e23261b448dc8fe637aeaf7bced2c.tar.xz
wireguard-openbsd-38a646d7021e23261b448dc8fe637aeaf7bced2c.zip
null pointers are not your friend
-rw-r--r--bin/ps/keyword.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 4862272fe20..a1543a515fd 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keyword.c,v 1.12 1997/11/06 15:59:54 kstailey Exp $ */
+/* $OpenBSD: keyword.c,v 1.13 1998/11/25 22:33:38 aaron Exp $ */
/* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: keyword.c,v 1.12 1997/11/06 15:59:54 kstailey Exp $";
+static char rcsid[] = "$OpenBSD: keyword.c,v 1.13 1998/11/25 22:33:38 aaron Exp $";
#endif
#endif /* not lint */
@@ -223,6 +223,8 @@ parsefmt(p)
while ((cp = strsep(&p, FMTSEP)) != NULL && *cp == '\0')
/* void */;
+ if (!cp)
+ break;
if (!(v = findvar(cp)) || v->parsed == 1)
continue;
v->parsed = 1;