X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fteamspeak2.c;h=1bd969bd9e158dcbf6d7bb92c5fd9e68f70ce599;hb=f66916deea905254061bb07245e007471faf2ecf;hp=f5eb26877fe170c57ed6940342595aede5595fe6;hpb=e14e8b7f5c5bf9d0fe5cc632c6383f304d4ac2ad;p=collectd.git diff --git a/src/teamspeak2.c b/src/teamspeak2.c index f5eb2687..1bd969bd 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -125,7 +125,6 @@ static void tss2_submit_gauge (const char *plugin_instance, vl.values = &(value_t) { .gauge = value }; vl.values_len = 1; - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin)); if (plugin_instance != NULL) @@ -147,15 +146,14 @@ static void tss2_submit_io (const char *plugin_instance, const char *type, /* * Submits the io rx/tx tuple to the collectd daemon */ - value_t values[2]; value_list_t vl = VALUE_LIST_INIT; - - values[0].derive = rx; - values[1].derive = tx; + value_t values[] = { + { .derive = rx }, + { .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, "teamspeak2", sizeof (vl.plugin)); if (plugin_instance != NULL)