From: Marc Fournier Date: Wed, 5 Aug 2015 16:05:02 +0000 (+0200) Subject: routeros: fix a small build error pointed out by clang X-Git-Tag: collectd-5.5.1~68^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4cfce925daf8e81c96c5bca630674f5e1f824067;p=collectd.git routeros: fix a small build error pointed out by clang routeros.c:334:35: error: 'memset' call operates on objects of type 'cr_data_t' (aka 'struct cr_data_s') while the size is based on a different type 'cr_data_t *' (aka 'struct cr_data_s *') [-Werror,-Wsizeof-pointer-memaccess] memset (router_data, 0, sizeof (router_data)); ~~~~~~~~~~~ ^~~~~~~~~~~ routeros.c:334:35: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)? memset (router_data, 0, sizeof (router_data)); ^~~~~~~~~~~ --- diff --git a/src/routeros.c b/src/routeros.c index 2ade3bb9..b29ff2bd 100644 --- a/src/routeros.c +++ b/src/routeros.c @@ -326,7 +326,7 @@ static int cr_config_router (oconfig_item_t *ci) /* {{{ */ router_data = malloc (sizeof (*router_data)); if (router_data == NULL) return (-1); - memset (router_data, 0, sizeof (router_data)); + memset (router_data, 0, sizeof (*router_data)); router_data->connection = NULL; router_data->node = NULL; router_data->service = NULL;