X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmadwifi.c;h=82c7e2faaae071cd0d108a9838e9325e0decc4ec;hb=a4b9c9ad2d77656892026ad4b51f9fb7c2a58149;hp=f8065a6d944dc12906a5605e474a001354e8ea33;hpb=e14e8b7f5c5bf9d0fe5cc632c6383f304d4ac2ad;p=collectd.git diff --git a/src/madwifi.c b/src/madwifi.c index f8065a6d..82c7e2fa 100644 --- a/src/madwifi.c +++ b/src/madwifi.c @@ -544,7 +544,6 @@ static void submit (const char *dev, const char *type, const char *ti1, vl.values = val; vl.values_len = len; - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "madwifi", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance)); sstrncpy (vl.type, type, sizeof (vl.type)); @@ -566,10 +565,12 @@ static void submit_derive (const char *dev, const char *type, const char *ti1, static void submit_derive2 (const char *dev, const char *type, const char *ti1, const char *ti2, derive_t val1, derive_t val2) { - value_t items[2]; - items[0].derive = val1; - items[1].derive = val2; - submit (dev, type, ti1, ti2, items, 2); + value_t values[] = { + { .derive = val1 }, + { .derive = val2 }, + }; + + submit (dev, type, ti1, ti2, values, STATIC_ARRAY_SIZE (values)); } static void submit_gauge (const char *dev, const char *type, const char *ti1,