Do not coredump if no options are supplied. (ps -o,)

Submitted by: rgrimes
Obtained from: NetBSD
This commit is contained in:
Jonathan Lemon 2001-02-14 18:54:34 +00:00
parent ad4ba1ec87
commit f6213d478d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72489

View File

@ -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);