X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fteamspeak2.c;h=a959cddc024ae66803000936763180cfe89c6320;hb=e53a4c2eafacb433e3a189ecada4f521caf6c615;hp=5b583b8971c54a5be18e9c05e2e52e479fadbca8;hpb=2079ee1517e34de372f58e7e2267ad5c71a8a41f;p=collectd.git diff --git a/src/teamspeak2.c b/src/teamspeak2.c index 5b583b89..a959cddc 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -108,14 +108,10 @@ static void tss2_submit_gauge(const char *plugin_instance, const char *type, /* * Submits a gauge value to the collectd daemon */ - value_t values[1]; value_list_t vl = VALUE_LIST_INIT; - values[0].gauge = value; - - vl.values = values; + 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) @@ -134,15 +130,13 @@ 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) @@ -734,5 +728,3 @@ void module_register(void) { plugin_register_read("teamspeak2", tss2_read); plugin_register_shutdown("teamspeak2", tss2_shutdown); } /* void module_register */ - -/* vim: set sw=4 ts=4 : */