X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Finterface.c;h=c0021d336c807b26084c94de70f40fde5cfb147c;hb=6d8031d73b7c1d874d7afa4cad2f248c4073764d;hp=b8ed6e402bf564b2185b11a1c2dee1416fef36b6;hpb=d0408cb0dbef15d739a6b1cd047e9c94d7643329;p=collectd.git diff --git a/src/interface.c b/src/interface.c index b8ed6e40..c0021d33 100644 --- a/src/interface.c +++ b/src/interface.c @@ -168,18 +168,17 @@ static void if_submit (const char *dev, const char *type, derive_t rx, derive_t tx) { - value_t values[2]; value_list_t vl = VALUE_LIST_INIT; + value_t values[] = { + { .derive = rx }, + { .derive = tx }, + }; if (ignorelist_match (ignorelist, dev) != 0) return; - values[0].derive = rx; - values[1].derive = tx; - vl.values = values; - vl.values_len = 2; - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + vl.values_len = STATIC_ARRAY_SIZE (values); sstrncpy (vl.plugin, "interface", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance)); sstrncpy (vl.type, type, sizeof (vl.type));