diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2018-02-13 14:57:22 +0100 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2018-02-13 14:59:40 +0100 |
commit | e1400c42e8a951a9a354c3196ec3f7e0a6686258 (patch) | |
tree | e3d9609d54430c6058fac307ae90e87cc5efe7a5 /modules | |
parent | Merge !481: detect_time_jump: keep cache on suspend-resume (diff) | |
download | knot-resolver-e1400c42e8a951a9a354c3196ec3f7e0a6686258.tar.xz knot-resolver-e1400c42e8a951a9a354c3196ec3f7e0a6686258.zip |
stats module: fix stats.list() returning nothing
I messed this up in 44c2ea6bb0 !465.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/stats/stats.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/stats/stats.c b/modules/stats/stats.c index 52517542..f0a517f8 100644 --- a/modules/stats/stats.c +++ b/modules/stats/stats.c @@ -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)); } } |