projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.6' into collectd-5.7
[collectd.git]
/
src
/
nut.c
diff --git
a/src/nut.c
b/src/nut.c
index
d48bcaf
..
d40e095
100644
(file)
--- a/
src/nut.c
+++ b/
src/nut.c
@@
-107,13
+107,10
@@
static int nut_config(const char *key, const char *value) {
static void nut_submit(nut_ups_t *ups, const char *type,
const char *type_instance, gauge_t value) {
static void nut_submit(nut_ups_t *ups, const char *type,
const char *type_instance, gauge_t value) {
- value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
value_list_t vl = VALUE_LIST_INIT;
- values[0].gauge = value;
-
- vl.values = values;
- vl.values_len = STATIC_ARRAY_SIZE(values);
+ vl.values = &(value_t){.gauge = value};
+ vl.values_len = 1;
sstrncpy(vl.host,
(strcasecmp(ups->hostname, "localhost") == 0) ? hostname_g
: ups->hostname,
sstrncpy(vl.host,
(strcasecmp(ups->hostname, "localhost") == 0) ? hostname_g
: ups->hostname,