Use Zero() rather than rely on C99 struct initialiser behaviour
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>
Tue, 4 Jan 2011 16:38:08 +0000 (16:38 +0000)
committerÆvar Arnfjörð Bjarmason <avar@cpan.org>
Tue, 4 Jan 2011 17:11:43 +0000 (17:11 +0000)
Signed-off-by: Ævar Arnfjörð Bjarmason <avar@cpan.org>
ext/Socket/Socket.xs

index 3c57048..d91fcab 100644 (file)
@@ -251,7 +251,7 @@ static void xs_getaddrinfo(pTHX_ CV *cv)
     char *hostname = NULL;
     char *servicename = NULL;
     STRLEN len;
-    struct addrinfo hints_s = {};
+    struct addrinfo hints_s;
     struct addrinfo *res;
     struct addrinfo *res_iter;
     int err;
@@ -291,6 +291,8 @@ static void xs_getaddrinfo(pTHX_ CV *cv)
         servicename = NULL;
     }
 
+    Zero(&hints_s, sizeof hints_s, char);
+
     if(hints && SvOK(hints)) {
       HV *hintshash;
       SV **valp;