summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e410b00)
raw | patch | inline | side by side (parent: e410b00)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 30 May 2016 21:29:05 +0000 (23:29 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 10 Jun 2016 19:04:49 +0000 (21:04 +0200) |
src/utils_curl_stats.c | patch | blob | history |
diff --git a/src/utils_curl_stats.c b/src/utils_curl_stats.c
index 0f2f56ead539bd0b12d7458d6948afb19cea1546..ff2eb641a2c0aecff43668f99c0da7e51dcd3570 100644 (file)
--- a/src/utils_curl_stats.c
+++ b/src/utils_curl_stats.c
oconfig_item_t *c = ci->children + i;
size_t field;
+ _Bool enabled = 0;
+
for (field = 0; field < STATIC_ARRAY_SIZE (field_specs); ++field) {
if (! strcasecmp (c->key, field_specs[field].config_key))
break;
return NULL;
}
- if ((c->values_num != 1)
- || (c->values[0].type != OCONFIG_TYPE_BOOLEAN)) {
- ERROR ("curl stats: `%s' expects a single boolean argument", c->key);
+
+ if (cf_util_get_boolean (c, &enabled) != 0) {
free (s);
return NULL;
}
-
- if (c->values[0].value.boolean)
+ if (enabled)
enable_field (s, field_specs[field].offset);
}