diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 1998-11-25 22:33:39 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 1998-11-25 22:33:39 +0000 |
commit | 73fecfbf6b26bfff2859905d05ce02787721db6c (patch) | |
tree | b924255105107425074c164111de7d6c3ee1bfd7 | |
parent | 5794a4028d9d5405de8f2e309eca217455cba073 (diff) |
null pointers are not your friend
-rw-r--r-- | bin/ps/keyword.c | 6 |
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; |