Commit e1400c42 authored by Vladimír Čunát's avatar Vladimír Čunát

stats module: fix stats.list() returning nothing

I messed this up in 44c2ea6b !465.
parent 85465e5c
- detect_time_jump module: don't clear cache on suspend-resume (#284)
- stats module: fix stats.list() returning nothing, regressed in 2.0.0
Knot Resolver 2.0.0 (2018-01-31)
......
......@@ -313,7 +313,7 @@ static char* stats_list(void *env, struct kr_module *module, const char *args)
size_t args_len = args ? strlen(args) : 0;
for (unsigned i = 0; i < metric_const_end; ++i) {
struct const_metric_elm *elm = &const_metrics[i];
if (args && strncmp(elm->key, args, args_len) == 0) {
if (!args || strncmp(elm->key, args, args_len) == 0) {
json_append_member(root, elm->key, json_mknumber(elm->val));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment