Explorar o código

PubSub: Fix GCC issue for structure initialization #2134

The issue and the solution were reported by Andrew Crosland.
Julius Pfrommer %!s(int64=6) %!d(string=hai) anos
pai
achega
e083b179a2
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      plugins/ua_network_pubsub_ethernet.c

+ 2 - 1
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));