summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2021-09-07 08:14:26 +0100
committerAlastair Poole <netstar@gmail.com>2021-09-07 08:15:08 +0100
commit79a15be29495241da520ee4242c9cab5dd1d732c (patch)
tree10c0ff23d134bd8b333e6037fd172b3cdbb353a5
parent5d3f6ad5946c52030708c9bfa4b596ed211dcc3f (diff)
procstats: check null return / ptr.
-rw-r--r--src/modules/procstats/process.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/procstats/process.c b/src/modules/procstats/process.c
index c237d103a..5e534eb75 100644
--- a/src/modules/procstats/process.c
+++ b/src/modules/procstats/process.c
@@ -203,11 +203,11 @@ _cmd_args(Proc_Info *p, char *name, size_t len)
203 snprintf(name, len, "%s", ecore_file_file_get(line)); 203 snprintf(name, len, "%s", ecore_file_file_get(line));
204 204
205 n = line; 205 n = line;
206 while (*n && (*n + 1)) 206 while ((n) && (*n) && (*n + 1))
207 { 207 {
208 eina_strbuf_append(buf, n); 208 eina_strbuf_append(buf, n);
209 n = strchr(n, '\0') + 1; 209 n = strchr(n, '\0') + 1;
210 if (*n && (*n + 1)) eina_strbuf_append(buf, " "); 210 if ((n) && (*n) && (*n + 1)) eina_strbuf_append(buf, " ");
211 } 211 }
212 p->arguments = eina_strbuf_release(buf); 212 p->arguments = eina_strbuf_release(buf);
213 } 213 }