wmbiff: Use unsigned data type for port number.

This commit is contained in:
Doug Torrance 2016-11-30 21:16:45 -05:00 committed by Carlos R. Mafra
parent cd4985a5cb
commit 2bea3d42e0
2 changed files with 6 additions and 5 deletions

View file

@ -18,6 +18,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/time.h>
#ifdef HAVE_GCRYPT_H
@ -78,8 +79,8 @@ typedef struct _mbox_t {
char password[BUF_SMALL];
char userName[BUF_BIG];
char serverName[BUF_BIG];
int serverPort;
int localPort;
uint16_t serverPort;
uint16_t localPort;
char authList[100];
unsigned int dossl:1; /* use tls. */
/* prompt the user if we can't login / password is empty */
@ -113,7 +114,7 @@ int shellCreate( /*@notnull@ */ Pop3 pc, const char *str);
int mboxCreate( /*@notnull@ */ Pop3 pc, const char *str);
int maildirCreate( /*@notnull@ */ Pop3 pc, const char *str);
int sock_connect(const char *hostname, int port);
int sock_connect(const char *hostname, uint16_t port);
FILE *openMailbox(Pop3 pc, const char *mbox_filename);
/* backtickExpand returns null on failure */

View file

@ -48,7 +48,7 @@ static int sanity_check_hostname(const char *hostname)
|| inet_aton(hostname, &dummy));
}
static int ipv4_sock_connect(struct in_addr *address, short port)
static int ipv4_sock_connect(struct in_addr *address, uint16_t port)
{
struct sockaddr_in addr;
int fd, i;
@ -82,7 +82,7 @@ static int ipv4_sock_connect(struct in_addr *address, short port)
/* 1 June 2002; incorporated IPv6 support by
Jun-ichiro itojun Hagino <itojun@iijlab.net>, thanks! */
int sock_connect(const char *hostname, int port)
int sock_connect(const char *hostname, uint16_t port)
{
#ifdef HAVE_GETADDRINFO
struct addrinfo hints, *res, *res0;