aboutsummaryrefslogtreecommitdiffstats
path: root/system.c
diff options
context:
space:
mode:
authorreinelt <>2001-03-13 08:34:15 +0000
committerreinelt <>2001-03-13 08:34:15 +0000
commit6465b5a730a285a6e57b87de3004b5cfa1668e01 (patch)
treef0b10feb1d65abe27985aaf44090689ccfa8f41f /system.c
parentbed646f0cbe8c358af9f4c2088d1524f8bc78121 (diff)
downloadlcd4linux-6465b5a730a285a6e57b87de3004b5cfa1668e01.tar.gz
[lcd4linux @ 2001-03-13 08:34:15 by reinelt]
corrected a off-by-one bug with sensors
Diffstat (limited to 'system.c')
-rw-r--r--system.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/system.c b/system.c
index cbf1bfe..a1a9b1c 100644
--- a/system.c
+++ b/system.c
@@ -1,4 +1,4 @@
-/* $Id: system.c,v 1.22 2001/03/12 12:39:36 reinelt Exp $
+/* $Id: system.c,v 1.23 2001/03/13 08:34:15 reinelt Exp $
*
* system status retreivement
*
@@ -20,6 +20,10 @@
*
*
* $Log: system.c,v $
+ * Revision 1.23 2001/03/13 08:34:15 reinelt
+ *
+ * corrected a off-by-one bug with sensors
+ *
* Revision 1.22 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
@@ -730,14 +734,14 @@ int Sensor (int index, double *val, double *min, double *max)
{
char buffer[32];
double dummy, value;
- static int fd[SENSORS]={[0 ... SENSORS-1]=-2,};
- static char *sensor[SENSORS]={NULL,};
- static double val_buf[SENSORS]={0.0,};
- static double min_buf[SENSORS]={0.0,};
- static double max_buf[SENSORS]={0.0,};
- static time_t now[SENSORS]={0,};
-
- if (index<1 || index>=SENSORS) return -1;
+ static int fd[SENSORS+1]={[0 ... SENSORS]=-2,};
+ static char *sensor[SENSORS+1]={NULL,};
+ static double val_buf[SENSORS+1]={0.0,};
+ static double min_buf[SENSORS+1]={0.0,};
+ static double max_buf[SENSORS+1]={0.0,};
+ static time_t now[SENSORS+1]={0,};
+
+ if (index<0 || index>SENSORS) return -1;
*val=val_buf[index];
*min=min_buf[index];