Code

Misc fixes, thanks to octo for pointing them out
authorClément Stenac <clement.stenac@exalead.com>
Sun, 14 Mar 2010 08:14:11 +0000 (09:14 +0100)
committerClément Stenac <clement.stenac@exalead.com>
Sun, 14 Mar 2010 08:14:11 +0000 (09:14 +0100)
src/processes.c

index 8853660c89bcebf7f24c658007ccd8b72f0d9001..7bbd3f6b5e35dd158c06b9a2419cd3bd5c413057 100644 (file)
@@ -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;