use strict;
{ use 5.006001; }
-our $VERSION = '2.000';
+our $VERSION = '2.001';
=head1 NAME
=head2 $address = inet_pton $family, $string
Takes an address family (such as C<AF_INET> or C<AF_INET6>) and a string
-giving the name of a host, or a textual representation of an IP address and
+containing a textual representation of an address in that family and
translates that to an packed binary address structure.
See also getaddrinfo() for a more powerful and flexible function to look up
hintshash = (HV*)SvRV(hints);
- if((valp = hv_fetch(hintshash, "flags", 5, 0)) != NULL)
+ if((valp = hv_fetch(hintshash, "flags", 5, 0)) != NULL && SvOK(*valp))
hints_s.ai_flags = SvIV(*valp);
- if((valp = hv_fetch(hintshash, "family", 6, 0)) != NULL)
+ if((valp = hv_fetch(hintshash, "family", 6, 0)) != NULL && SvOK(*valp))
hints_s.ai_family = SvIV(*valp);
- if((valp = hv_fetch(hintshash, "socktype", 8, 0)) != NULL)
+ if((valp = hv_fetch(hintshash, "socktype", 8, 0)) != NULL && SvOK(*valp))
hints_s.ai_socktype = SvIV(*valp);
- if((valp = hv_fetch(hintshash, "protocol", 8, 0)) != NULL)
+ if((valp = hv_fetch(hintshash, "protocol", 8, 0)) != NULL && SvOK(*valp))
hints_s.ai_protocol = SvIV(*valp);
}
getpeername and getsockname is not equal to sizeof(addr). */
if (sockaddrlen < sizeof(addr)) {
Copy(sun_ad, &addr, sockaddrlen, char);
- Zero(&addr+sockaddrlen, sizeof(addr)-sockaddrlen, char);
+ Zero(((char*)&addr) + sockaddrlen, sizeof(addr) - sockaddrlen, char);
} else {
Copy(sun_ad, &addr, sizeof(addr), char);
}