diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 12:16:44 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 13:08:47 +0200 |
commit | 6006b807b1a84d31611173b837fafcd96ba9d692 (patch) | |
tree | 08f25453328d8c408f1a8c658e4e6ef91005d4a7 /ospf6d/ospf6_route.c | |
parent | ripd: Use correct usage of memcpy() when zeroing struct (diff) | |
download | frr-6006b807b1a84d31611173b837fafcd96ba9d692.tar.xz frr-6006b807b1a84d31611173b837fafcd96ba9d692.zip |
*: Properly use memset() when zeroing
Wrong: memset(&a, 0, sizeof(struct ...));
Good: memset(&a, 0, sizeof(a));
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_route.c')
-rw-r--r-- | ospf6d/ospf6_route.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 3c74ca55c..8e964393f 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -1550,7 +1550,7 @@ int ospf6_route_table_show(struct vty *vty, int argc_start, int argc, int arg_end = use_json ? (argc - 1) : argc; json_object *json = NULL; - memset(&prefix, 0, sizeof(struct prefix)); + memset(&prefix, 0, sizeof(prefix)); if (use_json) json = json_object_new_object(); @@ -1723,9 +1723,9 @@ int ospf6_linkstate_table_show(struct vty *vty, int idx_ipv4, int argc, int i, ret; struct prefix router, id, prefix; - memset(&router, 0, sizeof(struct prefix)); - memset(&id, 0, sizeof(struct prefix)); - memset(&prefix, 0, sizeof(struct prefix)); + memset(&router, 0, sizeof(router)); + memset(&id, 0, sizeof(id)); + memset(&prefix, 0, sizeof(prefix)); for (i = idx_ipv4; i < argc; i++) { if (strmatch(argv[i]->text, "detail")) { |