diff mbox series

[netifd,4/5] netifd: Explicitly zero initialize variables

Message ID 20230219152027.3417324-5-hauke@hauke-m.de
State Accepted
Delegated to: Hauke Mehrtens
Headers show
Series Fix some compiler warnings | expand

Commit Message

Hauke Mehrtens Feb. 19, 2023, 3:20 p.m. UTC
The -pedantic option was complaining about the old initialization and
prefers if it is explicitly initialized to zero.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 proto.c        | 2 +-
 system-linux.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/proto.c b/proto.c
index 01473f2..48dd213 100644
--- a/proto.c
+++ b/proto.c
@@ -416,7 +416,7 @@  proto_apply_static_ip_settings(struct interface *iface, struct blob_attr *attr)
 	unsigned int netmask = 32;
 	bool ip6deprecated;
 	int n_v4 = 0, n_v6 = 0;
-	struct in_addr bcast = {}, ptp = {};
+	struct in_addr bcast = {0,}, ptp = {0,};
 
 	blobmsg_parse(proto_ip_attributes, __OPT_MAX, tb, blob_data(attr), blob_len(attr));
 
diff --git a/system-linux.c b/system-linux.c
index d13a561..e4041fb 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -1529,7 +1529,7 @@  int system_netns_set(int netns_fd)
 int system_veth_add(struct device *veth, struct veth_config *cfg)
 {
 	struct nl_msg *msg;
-	struct ifinfomsg empty_iim = {};
+	struct ifinfomsg empty_iim = {0,};
 	struct nlattr *linkinfo, *data, *veth_info;
 	int rv;