diff options
author | reinelt <> | 2001-03-13 08:34:15 +0000 |
---|---|---|
committer | reinelt <> | 2001-03-13 08:34:15 +0000 |
commit | 6465b5a730a285a6e57b87de3004b5cfa1668e01 (patch) | |
tree | f0b10feb1d65abe27985aaf44090689ccfa8f41f /processor.c | |
parent | bed646f0cbe8c358af9f4c2088d1524f8bc78121 (diff) | |
download | lcd4linux-6465b5a730a285a6e57b87de3004b5cfa1668e01.tar.gz |
[lcd4linux @ 2001-03-13 08:34:15 by reinelt]
corrected a off-by-one bug with sensors
Diffstat (limited to 'processor.c')
-rw-r--r-- | processor.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/processor.c b/processor.c index 173412f..8676747 100644 --- a/processor.c +++ b/processor.c @@ -1,4 +1,4 @@ -/* $Id: processor.c,v 1.18 2001/03/08 15:25:38 ltoetsch Exp $ +/* $Id: processor.c,v 1.19 2001/03/13 08:34:15 reinelt Exp $ * * main data processing * @@ -20,6 +20,10 @@ * * * $Log: processor.c,v $ + * Revision 1.19 2001/03/13 08:34:15 reinelt + * + * corrected a off-by-one bug with sensors + * * Revision 1.18 2001/03/08 15:25:38 ltoetsch * improved exec * @@ -148,8 +152,8 @@ struct { int usage, in, out, total, max, peak; } isdn; struct { int rx, tx, total, max, peak; } ppp; struct { int perc, stat; double dur; } batt; struct { double perc, cput; } seti; -struct { int num; } mail[MAILBOXES]; -struct { double val, min, max; } sensor[SENSORS]; +struct { int num; } mail[MAILBOXES+1]; +struct { double val, min, max; } sensor[SENSORS+1]; static double query (int token) { @@ -516,19 +520,19 @@ static void collect_data (void) Battery (&batt.perc, &batt.stat, &batt.dur); } - for (i=1; i<=MAILBOXES; i++) { + for (i=0; i<=MAILBOXES; i++) { if (token_usage[T_MAIL]&(1<<i)) { Mail (i, &mail[i].num); } } - for (i=1; i<SENSORS; i++) { + for (i=0; i<=SENSORS; i++) { if (token_usage[T_SENSOR]&(1<<i)) { Sensor (i, &sensor[i].val, &sensor[i].min, &sensor[i].max); } } - for (i=1; i<EXECS; i++) { + for (i=0; i<=EXECS; i++) { if (token_usage[T_EXEC]&(1<<i)) { Exec (i, exec[i].s, &exec[i].val); } |