From 7947c37b14ab964be46d5b28be8954d0646540ca Mon Sep 17 00:00:00 2001 From: jlemon Date: Wed, 14 Feb 2001 18:54:34 +0000 Subject: Do not coredump if no options are supplied. (ps -o,) Submitted by: rgrimes Obtained from: NetBSD --- bin/ps/keyword.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index 6a6b277..af33593 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -219,7 +219,7 @@ parsefmt(p) while ((cp = strsep(&p, FMTSEP)) != NULL && *cp == '\0') /* void */; - if (!(v = findvar(cp))) + if (cp == NULL || !(v = findvar(cp))) continue; if ((vent = malloc(sizeof(struct varent))) == NULL) err(1, NULL); -- cgit v1.1