X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftape.c;h=8ec9bf28dcefc303a8e0cbf8495341b46cb508c6;hb=f7649ae4a3270efe73f55bd00ca7fb89f269b8ec;hp=52da2bc69db465a6e99bf97e529f43c56a0cd5c8;hpb=5523a080010dcb7a61dc0dccc3969a2a048e52f9;p=collectd.git diff --git a/src/tape.c b/src/tape.c index 52da2bc6..8ec9bf28 100644 --- a/src/tape.c +++ b/src/tape.c @@ -61,14 +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; + vl.values_len = STATIC_ARRAY_SIZE (values); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "tape", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, plugin_instance,