procstats: check null return / ptr.

This commit is contained in:
Alastair Poole 2021-09-07 08:14:26 +01:00
parent 5d3f6ad594
commit 79a15be294
1 changed files with 2 additions and 2 deletions

View File

@ -203,11 +203,11 @@ _cmd_args(Proc_Info *p, char *name, size_t len)
snprintf(name, len, "%s", ecore_file_file_get(line));
n = line;
while (*n && (*n + 1))
while ((n) && (*n) && (*n + 1))
{
eina_strbuf_append(buf, n);
n = strchr(n, '\0') + 1;
if (*n && (*n + 1)) eina_strbuf_append(buf, " ");
if ((n) && (*n) && (*n + 1)) eina_strbuf_append(buf, " ");
}
p->arguments = eina_strbuf_release(buf);
}