}
/*
- Returns the minimal value of a given 'type' (SENSOR_TYPE_TEMP or
- SENSOR_TYPE_FAN)
+ * Returns the minimal value of a given 'type' (SENSOR_TYPE_TEMP or
+ * SENSOR_TYPE_FAN)
*/
static double get_min_value(struct psensor **sensors, int type)
{
}
/*
- Returns the maximal value of a given 'type' (SENSOR_TYPE_TEMP or
- SENSOR_TYPE_FAN)
+ * Returns the maximal value of a given 'type' (SENSOR_TYPE_TEMP or
+ * SENSOR_TYPE_FAN)
*/
double get_max_value(struct psensor **sensors, int type)
{
void psensor_log_measures(struct psensor **sensors)
{
- if (log_level == LOG_DEBUG)
+ if (log_level == LOG_DEBUG) {
+ if (!sensors)
+ return;
+
while (*sensors) {
log_debug("Measure: %s %.2f",
(*sensors)->name,
sensors++;
}
+ }
}
struct psensor **psensor_list_copy(struct psensor **sensors)