X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ffscache.c;h=3a5baf5bb11e1eac7ca367227a32a52bf3d80a62;hb=1d888f3f3a131f8eb2d9e0884665b6951ecee550;hp=8fbd271394e90554fcf92f1c850f6b4733242537;hpb=7a6887ad7eef33e04bcb0720c213d05fd9be8a59;p=collectd.git diff --git a/src/fscache.c b/src/fscache.c index 8fbd2713..3a5baf5b 100644 --- a/src/fscache.c +++ b/src/fscache.c @@ -20,6 +20,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include /* a header needed for FILE */ @@ -114,7 +115,6 @@ static void fscache_submit (const char *section, const char *name, vl.values = &value; vl.values_len = 1; - sstrncpy(vl.host, hostname_g, sizeof (vl.host)); sstrncpy(vl.plugin, "fscache", sizeof (vl.plugin)); sstrncpy(vl.plugin_instance, section, sizeof (vl.plugin_instance)); sstrncpy(vl.type, "fscache_stat", sizeof(vl.type)); @@ -158,7 +158,6 @@ static void fscache_read_stats_file (FILE *fh) char *lineptr; char *fields[32]; int fields_num; - int i; /* Find the colon and replace it with a null byte */ lineptr = strchr (linebuffer, ':'); @@ -175,14 +174,14 @@ static void fscache_read_stats_file (FILE *fh) section_len--; section[section_len] = 0; } - if (section_len <= 0) + if (section_len == 0) continue; fields_num = strsplit (lineptr, fields, STATIC_ARRAY_SIZE (fields)); if (fields_num <= 0) continue; - for (i = 0; i < fields_num; i++) + for (int i = 0; i < fields_num; i++) { char *field_name; char *field_value_str;