summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50b1910)
raw | patch | inline | side by side (parent: 50b1910)
author | Florian Forster <octo@collectd.org> | |
Fri, 20 Nov 2015 10:01:38 +0000 (11:01 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 20 Nov 2015 10:01:38 +0000 (11:01 +0100) |
src/apache.c | patch | blob | history |
diff --git a/src/apache.c b/src/apache.c
index 864dfcf84256bb84facb7fee1f0560f39cf83fca..13c8db66801291fb05cac46171ce089e14175e47 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
while ((line = strtok_r (ptr, "\n\r", &saveptr)) != NULL)
{
ptr = NULL;
- fields_num = strsplit (line, fields, 4);
+ fields_num = strsplit (line, fields, STATIC_ARRAY_SIZE (fields));
if (fields_num == 3)
{
- if ((strcmp (fields[0], "Total") == 0)
- && (strcmp (fields[1], "Accesses:") == 0))
- submit_derive ("apache_requests", "",
- atoll (fields[2]), st);
- else if ((strcmp (fields[0], "Total") == 0)
- && (strcmp (fields[1], "kBytes:") == 0))
- submit_derive ("apache_bytes", "",
- 1024LL * atoll (fields[2]), st);
+ if ((strcmp (fields[0], "Total") == 0) && (strcmp (fields[1], "Accesses:") == 0))
+ submit_derive ("apache_requests", "", atoll (fields[2]), st);
+ else if ((strcmp (fields[0], "Total") == 0) && (strcmp (fields[1], "kBytes:") == 0))
+ submit_derive ("apache_bytes", "", 1024LL * atoll (fields[2]), st);
}
else if (fields_num == 2)
{