X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftape.c;h=c7d56c736b4a1d1261b165517aede4b32ae7239a;hb=b614c13af47dab0544085f0e143fc0e190c979aa;hp=52da2bc69db465a6e99bf97e529f43c56a0cd5c8;hpb=da612fa9c6a3343b43789569d64197d7c690be52;p=collectd.git diff --git a/src/tape.c b/src/tape.c index 52da2bc6..c7d56c73 100644 --- a/src/tape.c +++ b/src/tape.c @@ -61,15 +61,14 @@ static void tape_submit (const char *plugin_instance, const char *type, derive_t read, derive_t write) { - value_t values[2]; value_list_t vl = VALUE_LIST_INIT; - - values[0].derive = read; - values[1].derive = write; + value_t values[] = { + { .derive = read }, + { .derive = write }, + }; 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, "tape", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));