Use unsigned shorts for ports.
authorPerl 5 Porters <perl5-porters.nicoh.com>
Mon, 8 Jan 1996 08:59:52 +0000 (08:59 +0000)
committerAndy Dougherty <doughera.lafayette.edu>
Mon, 8 Jan 1996 08:59:52 +0000 (08:59 +0000)
ext/Socket/Socket.xs

index 191afa6..378824f 100644 (file)
@@ -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)));
        }