projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6553ee5
)
Misc fixes, thanks to octo for pointing them out
author
Clément Stenac
<clement.stenac@exalead.com>
Sun, 14 Mar 2010 08:14:11 +0000
(09:14 +0100)
committer
Clément Stenac
<clement.stenac@exalead.com>
Sun, 14 Mar 2010 08:14:11 +0000
(09:14 +0100)
src/processes.c
patch
|
blob
|
history
diff --git
a/src/processes.c
b/src/processes.c
index
8853660
..
7bbd3f6
100644
(file)
--- a/
src/processes.c
+++ b/
src/processes.c
@@
-759,15
+759,16
@@
static procstat_t *ps_read_vmem (int pid, procstat_t *ps)
if ((fh = fopen (filename, "r")) == NULL)
return (NULL);
- while (fgets (buffer,
1024
, fh) != NULL)
+ while (fgets (buffer,
sizeof(buffer)
, fh) != NULL)
{
long long tmp;
char *endptr;
- if (strnc
asec
mp (buffer, "Vm", 2) != 0)
+ if (strncmp (buffer, "Vm", 2) != 0)
continue;
- numfields = strsplit (buffer, fields, 8);
+ numfields = strsplit (buffer, fields,
+ STATIC_ARRAY_SIZE (fields));
if (numfields < 2)
continue;