Fix declaration-after-statement in ext/Socket/Socket.xs
authorAndy Dougherty <doughera@lafayette.edu>
Thu, 9 Apr 2009 15:41:34 +0000 (11:41 -0400)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Thu, 9 Apr 2009 16:06:33 +0000 (18:06 +0200)
This trivial patch lets C89-ish compilers compile Socket.c again.

Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
ext/Socket/Socket.xs

index 064de2e..75d0f33 100644 (file)
@@ -477,13 +477,14 @@ inet_pton(af, host)
         const char *  host
         CODE:
 #ifdef HAS_INETPTON
+        int ok;
         struct in6_addr ip_address;
         if(af != AF_INET && af != AF_INET6) {
            croak("Bad address family for %s, got %d, should be either AF_INET or AF_INET6",
                         "Socket::inet_pton",
                         af);
         }
-        int ok = (*host != '\0') && inet_pton(af, host, &ip_address);
+        ok = (*host != '\0') && inet_pton(af, host, &ip_address);
 
         ST(0) = sv_newmortal();
         if (ok) {