X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmultimeter.c;h=9321daf8e9176831903ec89e1aee70def9f5cd3a;hb=c5ffa797883f238776e6294054f260df3cd0aea6;hp=491e641352c94edf8228cacc9061d1c24344eda4;hpb=4103105fb43cd72294f165b2541540b3a8a99532;p=collectd.git diff --git a/src/multimeter.c b/src/multimeter.c index 491e6413..9321daf8 100644 --- a/src/multimeter.c +++ b/src/multimeter.c @@ -149,10 +149,9 @@ static int multimeter_read_value(double *value) static int multimeter_init (void) { - int i; char device[] = "/dev/ttyS "; - for (i = 0; i < 10; i++) + for (int i = 0; i < 10; i++) { device[strlen(device)-1] = i + '0'; @@ -194,14 +193,10 @@ static int multimeter_init (void) static void multimeter_submit (double value) { - 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, "multimeter", sizeof (vl.plugin)); sstrncpy (vl.type, "multimeter", sizeof (vl.type));