X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fprocesses.c;h=fd06b21b4949d88cff169806d01abee98720ce03;hb=be99a844a40d7037a910d37a894988b807631a6e;hp=8337f99a735137fa6ff799e104a7a6fe5b48303f;hpb=c327b3ae6b19713a56631e81886988121d3eef93;p=collectd.git diff --git a/src/processes.c b/src/processes.c index 8337f99a..fd06b21b 100644 --- a/src/processes.c +++ b/src/processes.c @@ -634,14 +634,14 @@ static int ps_read_tasks (int pid) while ((ent = readdir (dh)) != NULL) { - if (!isdigit (ent->d_name[0])) + if (!isdigit ((int) ent->d_name[0])) continue; else count++; } closedir (dh); - return (count?count:1); + return ((count >= 1) ? count : 1); } /* int *ps_read_tasks */ int ps_read_process (int pid, procstat_t *ps, char *state)