X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=breezed.cc;h=6f079b2b181acad582cd825a758cc09a2f0967d0;hb=a1fa7f46df018db9b02903ffb3ebb840a3f5db18;hp=c958b13d2687f12a6c4b48b6323f494dcb0528fb;hpb=29d922d3b115ae81e076e9fc03e5ea986fc42630;p=breezed.git diff --git a/breezed.cc b/breezed.cc index c958b13..6f079b2 100644 --- a/breezed.cc +++ b/breezed.cc @@ -4,7 +4,7 @@ breezed is a fan speed control daemon for Linux computers. Copyright (c) 2008 Francois Fleuret - Written by Francois Fleuret + Written by Francois Fleuret This file is part of breezed. @@ -37,7 +37,7 @@ using namespace std; const int major_version_number = 1; -const int minor_version_number = 1; +const int minor_version_number = 0; const int buffer_size = 1024; @@ -61,7 +61,7 @@ int last_level = -1; int file_fan_fd; -int nb_temperature_thresholds = 0; +int nb_temperature_thresholds; int *temperature_thresholds = 0; int nb_file_thermal = 0; @@ -148,6 +148,8 @@ void define_temperature_thresholds(char *definition) { exit(1); } + nb_temperature_thresholds = 1; + char *s; s = definition; while(s) { @@ -157,8 +159,10 @@ void define_temperature_thresholds(char *definition) { temperature_thresholds = new int[nb_temperature_thresholds]; + temperature_thresholds[0] = -1; + s = definition; - int k = 0; + int k = 1; while(s) { s = next_word(token, s, buffer_size); temperature_thresholds[k] = atoi(token); @@ -170,8 +174,6 @@ void define_temperature_thresholds(char *definition) { } k++; } - - temperature_thresholds[0] = -1; } //////////////////////////////////////////////////////////////////////