From 4aacd6fef5b30fc74233c49d99f344c9cd1cc0b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cl=C3=A9ment=20Stenac?= Date: Sun, 14 Mar 2010 09:14:11 +0100 Subject: [PATCH] Misc fixes, thanks to octo for pointing them out --- src/processes.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; -- 2.11.0