From b7575eb006f8dfab66f6948deb53ecc6042ac8e7 Mon Sep 17 00:00:00 2001 From: Julius Pfrommer Date: Fri, 2 Nov 2018 17:01:15 +0100 Subject: [PATCH] PubSub: Fix GCC issue for structure initialization #2134 The issue and the solution were reported by Andrew Crosland. --- plugins/ua_network_pubsub_ethernet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/ua_network_pubsub_ethernet.c b/plugins/ua_network_pubsub_ethernet.c index 5f377d6765c..882b9c07095 100644 --- a/plugins/ua_network_pubsub_ethernet.c +++ b/plugins/ua_network_pubsub_ethernet.c @@ -154,7 +154,8 @@ UA_PubSubChannelEthernet_open(const UA_PubSubConnectionConfig *connectionConfig) } /* get interface index */ - struct ifreq ifreq = { 0 }; + struct ifreq ifreq; + memset(&ifreq, 0, sizeof(struct ifreq)); strncpy(ifreq.ifr_name, (char*)address->networkInterface.data, UA_MIN(address->networkInterface.length, sizeof(ifreq.ifr_name)-1));