From e1400c42e8a951a9a354c3196ec3f7e0a6686258 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Tue, 13 Feb 2018 14:57:22 +0100 Subject: stats module: fix stats.list() returning nothing I messed this up in 44c2ea6bb0 !465. --- modules/stats/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') 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)); } } -- cgit v1.2.3