Explorar o código

fixing valgind warning

Stasik0 %!s(int64=9) %!d(string=hai) anos
pai
achega
b3321a132f
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      examples/networklayer_tcp.c

+ 1 - 0
examples/networklayer_tcp.c

@@ -453,6 +453,7 @@ static UA_StatusCode ClientNetworkLayerTCP_connect(const UA_String endpointUrl,
 
     //this is somewhat ugly, but atoi needs a c string
     char cstringEndpointUrl[endpointUrl.length+1];
+    memset(cstringEndpointUrl, 0, endpointUrl.length+1);
     memcpy(cstringEndpointUrl, endpointUrl.data, endpointUrl.length);
     cstringEndpointUrl[endpointUrl.length+1] = '0';