Procházet zdrojové kódy

PubSub: Fix GCC issue for structure initialization #2134

The issue and the solution were reported by Andrew Crosland.
Julius Pfrommer před 6 roky
rodič
revize
e083b179a2
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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));