summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 57e0558)
raw | patch | inline | side by side (parent: 57e0558)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 5 Aug 2015 16:05:02 +0000 (18:05 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 5 Aug 2015 16:05:02 +0000 (18:05 +0200) |
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));
^~~~~~~~~~~
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));
^~~~~~~~~~~
src/routeros.c | patch | blob | history |
diff --git a/src/routeros.c b/src/routeros.c
index 2ade3bb9c9d2cceb90a71f8950353dd214f2c80a..b29ff2bdbeb5f1703ca7533dc71331a3ee5f7da7 100644 (file)
--- a/src/routeros.c
+++ b/src/routeros.c
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;