#include "collectd.h"
-#include "common.h"
#include "plugin.h"
+#include "utils/common/common.h"
#include <upsclient.h>
/* name = */ cb_name,
/* callback = */ nut_read,
/* interval = */ 0,
- /* user_data = */ &(user_data_t){
- .data = ups, .free_func = free_nut_ups_t,
+ /* user_data = */
+ &(user_data_t){
+ .data = ups,
+ .free_func = free_nut_ups_t,
});
sfree(cb_name);
static int nut_ca_path(const char *value) {
if (value != NULL && strcmp(value, "") != 0) {
- ca_path = malloc(strlen(value) + 1);
- strncpy(ca_path, value, (strlen(value) + 1));
+ ca_path = strdup(value);
} else {
ca_path = NULL; // Should alread be set to NULL from initialization
}