X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftape.c;h=3f4bb55b5d1b3113677dcd21dbf80debc0428ab6;hb=877672d20fcf0ed25f5fc5faa8aa3964c622bc27;hp=368acc45635027ec525a609826bf7f41653e8fbc;hpb=79963d13c1884d1d92667cc502ad20758b084a12;p=collectd.git diff --git a/src/tape.c b/src/tape.c index 368acc45..3f4bb55b 100644 --- a/src/tape.c +++ b/src/tape.c @@ -57,15 +57,13 @@ static int tape_init(void) { 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)); sstrncpy(vl.type, type, sizeof(vl.type));