]> git.webhop.me Git - lcd4linux.git/commitdiff
minor fixes to evaluator
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 20 Jan 2007 06:58:56 +0000 (06:58 +0000)
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 20 Jan 2007 06:58:56 +0000 (06:58 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@750 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

cfg.c
evaluator.c

diff --git a/cfg.c b/cfg.c
index 66359112095375b9f4a6f664fc959014c584f19b..c3c8338e6d3c95dc9fedea29afff52e379f45adc 100644 (file)
--- a/cfg.c
+++ b/cfg.c
@@ -413,13 +413,13 @@ int cfg_number(const char *section, const char *key, const int defval, const int
     DelResult(&result);
 
     if (*value < min) {
-       error("bad '%s' value '%d' in %s, minimum is %d", key, *value, cfg_source(), min);
+       error("bad '%s.%s' value '%d' in %s, minimum is %d", section, key, *value, cfg_source(), min);
        *value = min;
        return -1;
     }
 
     if (max > min && max != -1 && *value > max) {
-       error("bad '%s' value '%d' in %s, maximum is %d", key, *value, cfg_source(), max);
+       error("bad '%s.%s' value '%d' in %s, maximum is %d", section, key, *value, cfg_source(), max);
        *value = max;
        return -1;
     }
index c4c46a5cf3801c0636fcc7a6949f0079fe04f813..e2b103f08abf594f179bb98bd38d76ca0fe7ab96 100644 (file)
@@ -310,6 +310,10 @@ double R2N(RESULT * result)
        return 0.0;
     }
 
+    if (result->type == 0) {
+       return 0.0;
+    }
+
     if (result->type & R_NUMBER) {
        return result->number;
     }
@@ -332,6 +336,10 @@ char *R2S(RESULT * result)
        return NULL;
     }
 
+    if (result->type == 0) {
+       return NULL;
+    }
+
     if (result->type & R_STRING) {
        return result->string;
     }