From: Perl 5 Porters Date: Mon, 8 Jan 1996 08:59:52 +0000 (+0000) Subject: Use unsigned shorts for ports. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2c129a173eacf0ac1042dfc3673b8bd6ca3590b7;p=p5sagit%2Fp5-mst-13.2.git Use unsigned shorts for ports. --- diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 191afa6..378824f 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -678,7 +678,7 @@ unpack_sockaddr_un(sun_sv) void pack_sockaddr_in(port,ip_address) - short port + unsigned short port char * ip_address CODE: { @@ -699,7 +699,7 @@ unpack_sockaddr_in(sin_sv) { STRLEN sockaddrlen; struct sockaddr_in addr; - short port; + unsigned short port; struct in_addr ip_address; char * sin = SvPV(sin_sv,sockaddrlen); if (sockaddrlen != sizeof(addr)) { @@ -718,7 +718,7 @@ unpack_sockaddr_in(sin_sv) ip_address = addr.sin_addr; EXTEND(sp, 2); - PUSHs(sv_2mortal(newSViv(port))); + PUSHs(sv_2mortal(newSViv((IV) port))); PUSHs(sv_2mortal(newSVpv((char *)&ip_address,sizeof ip_address))); }