X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapache.c;h=d6712dcb7885748be6725dcbe8793873ecd0e8b2;hb=6254a76;hp=a333bf2b50a7db6a6ab39d1e2eaa962ca1902f17;hpb=91743fc0c8785f84f3976d5f5d430b1b3a7d4918;p=collectd.git diff --git a/src/apache.c b/src/apache.c index a333bf2b..d6712dcb 100644 --- a/src/apache.c +++ b/src/apache.c @@ -202,7 +202,7 @@ static int config_set_boolean (int *ret_boolean, /* {{{ */ return (-1); } - if (ci->values[0].type != OCONFIG_TYPE_BOOLEAN) + if (ci->values[0].type == OCONFIG_TYPE_BOOLEAN) { if (ci->values[0].value.boolean) *ret_boolean = 1; @@ -212,13 +212,9 @@ static int config_set_boolean (int *ret_boolean, /* {{{ */ else /* if (ci->values[0].type != OCONFIG_TYPE_STRING) */ { char *string = ci->values[0].value.string; - if ((strcasecmp ("true", string) == 0) - || (strcasecmp ("yes", string) == 0) - || (strcasecmp ("on", string) == 0)) + if (IS_TRUE (string)) *ret_boolean = 1; - else if ((strcasecmp ("false", string) == 0) - || (strcasecmp ("no", string) == 0) - || (strcasecmp ("off", string) == 0)) + else if (IS_FALSE (string)) *ret_boolean = 0; else {