Fix 'port' variable from `int' to `unsigned int' in crypto/bio/b_sock.c

Submitted by: Richard Levitte <levitte@stacken.kth.se>
Reviewed by: Ralf S. Engelschall
diff --git a/CHANGES b/CHANGES
index 0087fd5..44ff6d4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,9 @@
 
  Changes between 0.9.1c and 0.9.2
 
+  *) Fix 'port' variable from `int' to `unsigned int' in crypto/bio/b_sock.c
+     [Richard Levitte <levitte@stacken.kth.se>]
+
   *) Change type of another md_len variable in pk7_doit.c:PKCS7_dataFinal()
      from `int' to `unsigned int' because it's a length and initialized by
      EVP_DigestFinal() which expects an `unsigned int *'.
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index 402439c..f96cb60 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -483,7 +483,7 @@
 	struct sockaddr_in server,client;
 	int s= -1,cs;
 	unsigned char ip[4];
-	short port;
+	unsigned short port;
 	char *str,*h,*p,*e;
 	unsigned long l;
 	int err_num;
@@ -518,7 +518,7 @@
 
 	memset((char *)&server,0,sizeof(server));
 	server.sin_family=AF_INET;
-	server.sin_port=htons((unsigned short)port);
+	server.sin_port=htons(port);
 
 	if (strcmp(h,"*") == 0)
 		server.sin_addr.s_addr=INADDR_ANY;
@@ -610,7 +610,7 @@
 	int ret=INVALID_SOCKET;
 	static struct sockaddr_in from;
 	unsigned long l;
-	short port;
+	unsigned short port;
 	int len;
 	char *p;