exit(EXIT_FAILURE);
}
- nb_temperature_thresholds = 1;
+ nb_temperature_thresholds = 0;
char *s, *u;
speed_names =
safe_malloc(nb_temperature_thresholds * sizeof(char *));
- temperature_thresholds[0] = -1;
-
s = definition;
- int k = 1;
+ int k = 0;
while(s) {
s = next_word(token, s, buffer_size);
u = token;
}
k++;
}
+
+ if(nb_temperature_thresholds <= 0) {
+ fprintf(stderr, "There has to be at least one temperature.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if(temperature_thresholds[0] > 0) {
+ fprintf(stderr, "The lowest temperature has to be 0.\n");
+ exit(EXIT_FAILURE);
+ }
+
}
void evaluate_one_configuration_line(char *line, int line_number) {
nb_rounds_since_last_change = 0;
last_level = new_level;
if(debug) {
- printf("Temperature is %dC setting the fan level to %d.\n",
- temperature, new_level);
+ printf("Temperature is %dC setting the fan level to %d (%s).\n",
+ temperature,
+ new_level,
+ speed_names[new_level]);
}
}