From: Clément Stenac Date: Sun, 14 Mar 2010 08:14:11 +0000 (+0100) Subject: Misc fixes, thanks to octo for pointing them out X-Git-Tag: collectd-4.10.0~54^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4aacd6fef5b30fc74233c49d99f344c9cd1cc0b7;p=collectd.git Misc fixes, thanks to octo for pointing them out --- diff --git a/src/processes.c b/src/processes.c index 8853660c..7bbd3f6b 100644 --- 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 (strncasecmp (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;