[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Little change-request for do_temperature.c ...
- To: hobbit (at) hswn.dk
- Subject: Little change-request for do_temperature.c ...
- From: Rolf Masfelder <rolf.masfelder (at) nector.de>
- Date: Thu, 27 Dec 2007 09:18:58 +0100
- Organization: NECTOR IT-Services Limited
- User-agent: KMail/1.9.5
Hallo Henrik,
the last Days were a litle bit cold in germany. So i found that
rrd/do_temperature.c dont work correctly on negative values ...
In the part:
p = bol + strlen(bol) - 1;
while ((p > bol) && isspace((int)*p)) p--;
while ((p > bol) && isdigit((int)*p)) p--;
tmpF = atoi(p);
while ((p > bol) && isspace((int)*p)) p--;
while ((p > bol) && isdigit((int)*p)) p--;
tmpC = atoi(p);
there have be two additional lines of code:
p = bol + strlen(bol) - 1;
while ((p > bol) && isspace((int)*p)) p--;
while ((p > bol) && isdigit((int)*p)) p--;
--> while ((p > bol) && *p == '-') p--;
tmpF = atoi(p);
while ((p > bol) && isspace((int)*p)) p--;
while ((p > bol) && isdigit((int)*p)) p--;
--> while ((p > bol) && *p == '-') p--;
tmpC = atoi(p);
The rrd-File has to bee build with another Minimum for the Values
stored. I dont find the code for the creation, but
"rrdtool tune temperature.sensor4.rrd -i temperature:-10" did the job
for my environment.
please insert the lines of code into do_temperature.c
greetings
to All: (after christmas) I wish you a happy new year
Rolf