X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftarget_replace.c;h=8389ce3f5fca6fd4b878203c53f3449e1f266d9a;hb=cd2238b8b4f4ecd80c45862b5aeed3d3d73eddfe;hp=545fa3530f960a61c26be2012cbebd8fcc0d4290;hpb=aef15b632b9f415e5ebfadd4e41fa8a3c19407ee;p=collectd.git diff --git a/src/target_replace.c b/src/target_replace.c index 545fa353..8389ce3f 100644 --- a/src/target_replace.c +++ b/src/target_replace.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "filter_chain.h" #include "utils_subst.h" @@ -158,13 +159,12 @@ static int tr_action_invoke (tr_action_t *act_head, /* {{{ */ tr_action_t *act; int status; char buffer[DATA_MAX_NAME_LEN]; - regmatch_t matches[8]; + regmatch_t matches[8] = { [0] = { 0 } }; if (act_head == NULL) return (-EINVAL); sstrncpy (buffer, buffer_in, sizeof (buffer)); - memset (matches, 0, sizeof (matches)); DEBUG ("target_replace plugin: tr_action_invoke: <- buffer = %s;", buffer); @@ -346,9 +346,8 @@ static int tr_invoke (const data_set_t *ds, value_list_t *vl, /* {{{ */ void module_register (void) { - target_proc_t tproc; + target_proc_t tproc = { 0 }; - memset (&tproc, 0, sizeof (tproc)); tproc.create = tr_create; tproc.destroy = tr_destroy; tproc.invoke = tr_invoke;