command parser: Set command type to UNKNOWN upon failure.
[collectd.git] / src / contextswitch.c
index 344f76e..3bd6d9f 100644 (file)
@@ -22,6 +22,7 @@
  **/
 
 #include "collectd.h"
+
 #include "common.h"
 #include "plugin.h"
 
 
 static void cs_submit (derive_t context_switches)
 {
-       value_t values[1];
        value_list_t vl = VALUE_LIST_INIT;
 
-       values[0].derive = (derive_t) context_switches;
-
-       vl.values = values;
+       vl.values = &(value_t) { .derive = context_switches };
        vl.values_len = 1;
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "contextswitch", sizeof (vl.plugin));