diff options
Diffstat (limited to '')
-rw-r--r-- | cfg.c | 4 | ||||
-rw-r--r-- | evaluator.c | 8 |
2 files changed, 10 insertions, 2 deletions
@@ -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; } diff --git a/evaluator.c b/evaluator.c index c4c46a5..e2b103f 100644 --- a/evaluator.c +++ b/evaluator.c @@ -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; } |