platform: use struct initializer instead of memset()
I think this is preferred over memset(), because it allows the compiler to better unstand what is happening. Also, strictly speaking in the C language, %NULL pointers are not guaranteed to have an all zero bit pattern. Of course, that is already required on any architecture where NetworkManager is running.
This commit is contained in:
@@ -1942,9 +1942,10 @@ _wireguard_update_from_allowed_ips_nla (NMPWireGuardAllowedIP *allowed_ip,
|
||||
|
||||
_check_addr_or_return_val (tb, WGALLOWEDIP_A_IPADDR, addr_len, FALSE);
|
||||
|
||||
memset (allowed_ip, 0, sizeof (NMPWireGuardAllowedIP));
|
||||
*allowed_ip = (NMPWireGuardAllowedIP) {
|
||||
.family = family,
|
||||
};
|
||||
|
||||
allowed_ip->family = family;
|
||||
nm_assert ((int) allowed_ip->family == family);
|
||||
|
||||
if (tb[WGALLOWEDIP_A_IPADDR])
|
||||
|
Reference in New Issue
Block a user