summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c327b3a)
raw | patch | inline | side by side (parent: c327b3a)
author | Florian Forster <octo@huhu.verplant.org> | |
Thu, 17 Sep 2009 16:02:34 +0000 (18:02 +0200) | ||
committer | Florian 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 | patch | blob | history |
diff --git a/src/processes.c b/src/processes.c
index 8337f99a735137fa6ff799e104a7a6fe5b48303f..fd06b21b4949d88cff169806d01abee98720ce03 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
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)