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 8853660..7bbd3f6 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;