diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 13:16:44 +0300 |
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 14:08:47 +0300 |
| commit | 6006b807b1a84d31611173b837fafcd96ba9d692 (patch) | |
| tree | 08f25453328d8c408f1a8c658e4e6ef91005d4a7 /lib/table.c | |
| parent | f51eeb864bc821d92bd8e95670dde1258ed0747c (diff) | |
*: 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 'lib/table.c')
| -rw-r--r-- | lib/table.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/table.c b/lib/table.c index 523183bef2..6c4c6c7d36 100644 --- a/lib/table.c +++ b/lib/table.c @@ -228,7 +228,7 @@ struct route_node *route_node_match_ipv4(struct route_table *table, { struct prefix_ipv4 p; - memset(&p, 0, sizeof(struct prefix_ipv4)); + memset(&p, 0, sizeof(p)); p.family = AF_INET; p.prefixlen = IPV4_MAX_BITLEN; p.prefix = *addr; @@ -241,7 +241,7 @@ struct route_node *route_node_match_ipv6(struct route_table *table, { struct prefix_ipv6 p; - memset(&p, 0, sizeof(struct prefix_ipv6)); + memset(&p, 0, sizeof(p)); p.family = AF_INET6; p.prefixlen = IPV6_MAX_BITLEN; p.prefix = *addr; |
