From b1f5fffddaf31835515f88859f8a4670b6252deb Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Tue, 9 Sep 2003 06:54:43 +0000 Subject: [lcd4linux @ 2003-09-09 06:54:43 by reinelt] new function 'cfg_number()' --- filter.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'filter.c') diff --git a/filter.c b/filter.c index 32af53d..a9aa8af 100644 --- a/filter.c +++ b/filter.c @@ -1,4 +1,4 @@ -/* $Id: filter.c,v 1.6 2003/02/22 07:53:10 reinelt Exp $ +/* $Id: filter.c,v 1.7 2003/09/09 06:54:43 reinelt Exp $ * * smooth and damp functions * @@ -20,6 +20,9 @@ * * * $Log: filter.c,v $ + * Revision 1.7 2003/09/09 06:54:43 reinelt + * new function 'cfg_number()' + * * Revision 1.6 2003/02/22 07:53:10 reinelt * cfg_get(key,defval) * @@ -138,9 +141,9 @@ double damp(char *name, double value) double max; int i, j; - if (tau==-1) - tau=atoi(cfg_get("tau","500")); - + if (tau==-1) + if (cfg_number("tau", 500, 0, 1000000, &tau)<0) tau=0.0; + if (tau==0.0) return value; -- cgit v1.2.3