X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsigrok.c;h=6a8003c076e49cec33ac2e3e95cae0c4486de196;hb=9d9678b9e753ea0936612021f4f87f8092ab4e31;hp=400645538d7d842f5d47f422f1347a2be5d7112d;hpb=958f7776a2daaa1a8664aded0a2c1d717c2f5909;p=collectd.git diff --git a/src/sigrok.c b/src/sigrok.c index 40064553..6a8003c0 100644 --- a/src/sigrok.c +++ b/src/sigrok.c @@ -161,7 +161,6 @@ static void sigrok_feed_callback(const struct sr_dev_inst *sdi, { const struct sr_datafeed_analog *analog; struct config_device *cfdev; - value_t value; value_list_t vl = VALUE_LIST_INIT; /* Find this device's configuration. */ @@ -199,13 +198,10 @@ static void sigrok_feed_callback(const struct sr_dev_inst *sdi, /* Ignore all but the first sample on the first probe. */ analog = packet->payload; - value.gauge = analog->data[0]; - vl.values = &value; + vl.values = &(value_t) { .gauge = analog->data[0] }; vl.values_len = 1; - sstrncpy(vl.host, hostname_g, sizeof(vl.host)); sstrncpy(vl.plugin, "sigrok", sizeof(vl.plugin)); - ssnprintf(vl.plugin_instance, sizeof(vl.plugin_instance), - "%s", cfdev->name); + sstrncpy(vl.plugin_instance, cfdev->name, sizeof(vl.plugin_instance)); sstrncpy(vl.type, sigrok_value_type(analog), sizeof(vl.type)); plugin_dispatch_values(&vl); @@ -356,7 +352,7 @@ static int sigrok_init(void) } status = plugin_thread_create(&sr_thread, NULL, sigrok_read_thread, - NULL); + NULL, "sigrok read"); if (status != 0) { char errbuf[1024];