aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-01 15:36:56 +0000
committerYang Tse <yangsita@gmail.com>2007-02-01 15:36:56 +0000
commitd2dd3d7e16fcebdb34d41c944c5a5aef0d0d8bcf (patch)
treec3e413a5019a6f812a9bf6c37153e933f36529ed /lib/ftp.c
parent1c63ceb317f8bed76edeb63df4d77986f60c8710 (diff)
compiler warning fix
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 00aca12ee..479eeffe3 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1586,7 +1586,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
}
}
if(ptr) {
- newport = num;
+ newport = (unsigned short)(num & 0xffff);
if (conn->bits.tunnel_proxy)
/* proxy tunnel -> use other host info because ip_addr_str is the
@@ -1650,7 +1650,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
else
snprintf(newhost, sizeof(newhost),
"%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
- newport = (port[0]<<8) + port[1];
+ newport = (unsigned short)(((port[0]<<8) + port[1]) & 0xffff);
}
else if(ftpc->count1 == 0) {
/* EPSV failed, move on to PASV */