Tree wide: Use compound literals when dealing with value_t.
[collectd.git] / src / dns.c
index 0494b4b..ef80e57 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -370,12 +370,9 @@ static int dns_init (void)
 static void submit_derive (const char *type, const char *type_instance,
                derive_t value)
 {
-       value_t values[1];
        value_list_t vl = VALUE_LIST_INIT;
 
-       values[0].derive = value;
-
-       vl.values = values;
+       vl.values = &(value_t) { .derive = value };
        vl.values_len = 1;
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "dns", sizeof (vl.plugin));