projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c327b3a
)
processes plugin: Case argument of “isdigit” to int.
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
8337f99
..
fd06b21
100644
(file)
--- 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)