diff options
-rw-r--r-- | libnetdata/health/health.c | 2 | ||||
-rw-r--r-- | libnetdata/json/json.c | 11 | ||||
-rw-r--r-- | web/api/queries/query.c | 2 |
3 files changed, 5 insertions, 10 deletions
diff --git a/libnetdata/health/health.c b/libnetdata/health/health.c index a70f284b1f..e03538db3f 100644 --- a/libnetdata/health/health.c +++ b/libnetdata/health/health.c @@ -112,7 +112,7 @@ int health_silencers_json_read_callback(JSON_ENTRY *e) case JSON_OBJECT: #ifndef ENABLE_JSONC e->callback_function = health_silencers_json_read_callback; - if(e->name && strcmp(e->name,"")) { + if(strcmp(e->name,"")) { // init silencer debug(D_HEALTH, "JSON: Got object with a name, initializing new silencer for %s",e->name); #endif diff --git a/libnetdata/json/json.c b/libnetdata/json/json.c index 7c5adca3db..3ccc561c6f 100644 --- a/libnetdata/json/json.c +++ b/libnetdata/json/json.c @@ -284,18 +284,13 @@ size_t json_walk_primitive(char *js, jsmntok_t *t, size_t start, JSON_ENTRY *e) * @param t the tokens * @param nest the length of structure t * @param start the first position - * @param e the output structure. + * @param e the structure with values and callback to be used inside the function. * * @return It returns the array length */ size_t json_walk_array(char *js, jsmntok_t *t, size_t nest, size_t start, JSON_ENTRY *e) { - JSON_ENTRY ne = { - .name = "", - .fullname = "", - .callback_data = NULL, - .callback_function = NULL - }; + JSON_ENTRY ne; char old = js[t[start].end]; js[t[start].end] = '\0'; @@ -315,7 +310,7 @@ size_t json_walk_array(char *js, jsmntok_t *t, size_t nest, size_t start, JSON_E start++; for(i = 0; i < size ; i++) { ne.pos = i; - if (!e->name || !e->fullname || strlen(e->name) > JSON_NAME_LEN - 24 || strlen(e->fullname) > JSON_FULLNAME_LEN -24) { + if (strlen(e->name) > JSON_NAME_LEN - 24 || strlen(e->fullname) > JSON_FULLNAME_LEN -24) { info("JSON: JSON walk_array ignoring element with name:%s fullname:%s",e->name, e->fullname); continue; } diff --git a/web/api/queries/query.c b/web/api/queries/query.c index 6f186d3ac7..b0eb826d6b 100644 --- a/web/api/queries/query.c +++ b/web/api/queries/query.c @@ -1559,7 +1559,7 @@ RRDR *rrd2rrdr( rrd_update_every, first_entry_t, last_entry_t); #ifdef ENABLE_DBENGINE - if ((st->rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE)) { + if (st->rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE) { struct rrdeng_region_info *region_info_array; unsigned regions, max_interval; |