X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fopenvpn.c;h=1310c00ba45c14f6f8718d34b36b8bdd51254bba;hb=d425636110c5fb146d1f6205e2749218f3c31076;hp=69ab9fb14dbf237459cbc19c120a3fdc773589e1;hpb=e14e8b7f5c5bf9d0fe5cc632c6383f304d4ac2ad;p=collectd.git diff --git a/src/openvpn.c b/src/openvpn.c index 69ab9fb1..1310c00b 100644 --- a/src/openvpn.c +++ b/src/openvpn.c @@ -103,7 +103,6 @@ static void numusers_submit (const char *pinst, const char *tinst, vl.values = &(value_t) { .gauge = value }; vl.values_len = 1; - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin)); sstrncpy (vl.type, "users", sizeof (vl.type)); if (pinst != NULL) @@ -119,11 +118,11 @@ static void numusers_submit (const char *pinst, const char *tinst, static void iostats_submit (const char *pinst, const char *tinst, derive_t rx, derive_t tx) { - 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 }, + }; /* NOTE ON THE NEW NAMING SCHEMA: * using plugin_instance to identify each vpn config (and @@ -133,7 +132,6 @@ static void iostats_submit (const char *pinst, const char *tinst, vl.values = values; vl.values_len = STATIC_ARRAY_SIZE (values); - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin)); if (pinst != NULL) sstrncpy (vl.plugin_instance, pinst, @@ -149,15 +147,14 @@ static void iostats_submit (const char *pinst, const char *tinst, static void compression_submit (const char *pinst, const char *tinst, derive_t uncompressed, derive_t compressed) { - value_t values[2]; value_list_t vl = VALUE_LIST_INIT; - - values[0].derive = uncompressed; - values[1].derive = compressed; + value_t values[] = { + { .derive = uncompressed }, + { .derive = compressed }, + }; vl.values = values; vl.values_len = STATIC_ARRAY_SIZE (values); - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin)); if (pinst != NULL) sstrncpy (vl.plugin_instance, pinst,