From: Florian Forster Date: Thu, 17 Sep 2009 16:02:34 +0000 (+0200) Subject: processes plugin: Case argument of “isdigit” to int. X-Git-Tag: collectd-4.7.4~7 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=bb227c48e62e8f4adebd028293b3b85d1c7db244;p=collectd.git processes plugin: Case argument of “isdigit” to int. On some platforms passing a char there causes problems :/ --- 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)