Merge pull request #3329 from efuss/fix-3311
[collectd.git] / src / sigrok.c
index 8a325fe..07bd1c8 100644 (file)
@@ -21,8 +21,8 @@
 
 #include "collectd.h"
 
-#include "common.h"
 #include "plugin.h"
+#include "utils/common/common.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -247,10 +247,10 @@ static int sigrok_init_driver(struct config_device *cfdev,
   }
   cfdev->sdi = devlist->data;
   g_slist_free(devlist);
-  snprintf(hwident, sizeof(hwident), "%s %s %s",
-           cfdev->sdi->vendor ? cfdev->sdi->vendor : "",
-           cfdev->sdi->model ? cfdev->sdi->model : "",
-           cfdev->sdi->version ? cfdev->sdi->version : "");
+  ssnprintf(hwident, sizeof(hwident), "%s %s %s",
+            cfdev->sdi->vendor ? cfdev->sdi->vendor : "",
+            cfdev->sdi->model ? cfdev->sdi->model : "",
+            cfdev->sdi->version ? cfdev->sdi->version : "");
   INFO("sigrok plugin: Device \"%s\" is a %s", cfdev->name, hwident);
 
   if (sr_dev_open(cfdev->sdi) != SR_OK)
@@ -340,9 +340,7 @@ static int sigrok_init(void) {
   status = plugin_thread_create(&sr_thread, NULL, sigrok_read_thread, NULL,
                                 "sigrok read");
   if (status != 0) {
-    char errbuf[1024];
-    ERROR("sigrok plugin: Failed to create thread: %s.",
-          sstrerror(errno, errbuf, sizeof(errbuf)));
+    ERROR("sigrok plugin: Failed to create thread: %s.", STRERRNO);
     return -1;
   }
   sr_thread_running = TRUE;