Downgrade Socket.pm's new inet_ntop and inet_pton to EXPORT_OK rather
[p5sagit/p5-mst-13.2.git] / ext / Socket / Socket.xs
index 339b771..2d469ed 100644 (file)
@@ -503,7 +503,8 @@ inet_pton(af, host)
 
         ST(0) = sv_newmortal();
         if (ok) {
-                sv_setpvn( ST(0), (char *)&ip_address, sizeof ip_address );
+                sv_setpvn( ST(0), (char *)&ip_address,
+                           af == AF_INET6 ? sizeof(ip_address) : sizeof(struct in_addr) );
         }
 #else
         ST(0) = (SV *)not_here("inet_pton");