#include "collectd.h"
-#include "common.h"
#include "plugin.h"
-#include "utils_ignorelist.h"
+#include "utils/common/common.h"
+#include "utils/ignorelist/ignorelist.h"
#include <OpenIPMI/ipmi_auth.h>
#include <OpenIPMI/ipmi_conn.h>
if (errbuf[0] == 0) {
snprintf(errbuf, sizeof(errbuf), "Unknown error %#x", status);
}
- errbuf[sizeof(errbuf) - 1] = 0;
+ errbuf[sizeof(errbuf) - 1] = '\0';
ERROR("ipmi plugin: %s failed for `%s`: %s", func, st->name, errbuf);
} /* void c_ipmi_error */
return;
ipmi_sensor_get_name(sensor, temp, sizeof(temp));
- temp[sizeof(temp) - 1] = 0;
+ temp[sizeof(temp) - 1] = '\0';
if (entity_id_string != NULL && strlen(temp))
snprintf(sensor_name, sizeof(sensor_name), "%s %s", temp, entity_id_string);
/* find the db type by using sensor base unit type */
enum ipmi_unit_type_e ipmi_type = ipmi_sensor_get_base_unit(sensor);
- for (int i = 0; i < STATIC_ARRAY_SIZE(ipmi_db_type_map); i++)
+ for (size_t i = 0; i < STATIC_ARRAY_SIZE(ipmi_db_type_map); i++)
if (ipmi_db_type_map[i].type == ipmi_type)
return ipmi_db_type_map[i].type_name;
return 0;
}
- list_item = (c_ipmi_sensor_list_t *)calloc(1, sizeof(c_ipmi_sensor_list_t));
+ list_item = calloc(1, sizeof(*list_item));
if (list_item == NULL) {
pthread_mutex_unlock(&st->sensor_list_lock);
return -1;