X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmatch_timediff.c;h=00fdd0c1971bb4d044afc293d1d21d1e6a904e63;hb=04f27bdd38966e0b826b283d8790ce31fb467929;hp=750817be129b1db04ef64c4dd8956822c0338985;hpb=21ab7512825cf8177d5eee5101344b45d0854610;p=collectd.git diff --git a/src/match_timediff.c b/src/match_timediff.c index 750817be..00fdd0c1 100644 --- a/src/match_timediff.c +++ b/src/match_timediff.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "filter_chain.h" @@ -49,7 +50,6 @@ static int mt_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ { mt_match_t *m; int status; - int i; m = calloc (1, sizeof (*m)); if (m == NULL) @@ -62,7 +62,7 @@ static int mt_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ m->past = 0; status = 0; - for (i = 0; i < ci->children_num; i++) + for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; @@ -144,9 +144,8 @@ static int mt_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */ void module_register (void) { - match_proc_t mproc; + match_proc_t mproc = { 0 }; - memset (&mproc, 0, sizeof (mproc)); mproc.create = mt_create; mproc.destroy = mt_destroy; mproc.match = mt_match;