aboutsummaryrefslogtreecommitdiffstats
path: root/system.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2001-03-13 08:34:15 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2001-03-13 08:34:15 +0000
commitf3076919635e550ed752db4030468a3f256f60a1 (patch)
treef0b10feb1d65abe27985aaf44090689ccfa8f41f /system.c
parentab548cb3e831ea2443d6362acc319eb01c0ceab6 (diff)
downloadlcd4linux-f3076919635e550ed752db4030468a3f256f60a1.tar.gz
[lcd4linux @ 2001-03-13 08:34:15 by reinelt]
corrected a off-by-one bug with sensors git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@116 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
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];