Code

processes plugin: Case argument of “isdigit” to int.
authorFlorian Forster <octo@huhu.verplant.org>
Thu, 17 Sep 2009 16:02:34 +0000 (18:02 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Thu, 17 Sep 2009 16:02:34 +0000 (18:02 +0200)
On some platforms passing a char there causes problems :/

src/processes.c

index 8337f99a735137fa6ff799e104a7a6fe5b48303f..fd06b21b4949d88cff169806d01abee98720ce03 100644 (file)
@@ -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)