aboutsummaryrefslogtreecommitdiffstats
path: root/ftp.c
diff options
context:
space:
mode:
authorIto Hiroyuki <ZXB01226@nifty.com>2010-08-10 10:16:57 +0000
committerIto Hiroyuki <ZXB01226@nifty.com>2010-08-10 10:16:57 +0000
commit88b4721025bdf1f0910b2eaa66f2066e8752b0a6 (patch)
treec0ea3a28199ada4b2c87e2457ebeb92247c3edb5 /ftp.c
parent*** empty log message *** (diff)
downloadw3m-88b4721025bdf1f0910b2eaa66f2066e8752b0a6.tar.gz
w3m-88b4721025bdf1f0910b2eaa66f2066e8752b0a6.zip
[w3m-dev 04379] check socklen_t
Diffstat (limited to '')
-rw-r--r--ftp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ftp.c b/ftp.c
index e3f8c2e..f419b16 100644
--- a/ftp.c
+++ b/ftp.c
@@ -1,4 +1,4 @@
-/* $Id: ftp.c,v 1.39 2007/05/31 01:19:50 inu Exp $ */
+/* $Id: ftp.c,v 1.40 2010/08/10 10:16:57 htrb Exp $ */
#include <stdio.h>
#ifndef __MINGW32_VERSION
#include <pwd.h>
@@ -25,6 +25,10 @@
#include <winsock.h>
#endif /* __MINGW32_VERSION */
+#ifdef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
typedef struct _FTP {
char *host;
int port;
@@ -128,7 +132,7 @@ ftp_login(FTP ftp)
if (n > 0 && ftp->pass[n - 1] == '@') {
struct sockaddr_in sockname;
- int socknamelen = sizeof(sockname);
+ socklen_t socknamelen = sizeof(sockname);
if (!getsockname(sock, (struct sockaddr *)&sockname, &socknamelen)) {
struct hostent *sockent;
@@ -192,7 +196,8 @@ ftp_pasv(FTP ftp)
int family;
#ifdef INET6
struct sockaddr_storage sockaddr;
- int sockaddrlen, port;
+ int port;
+ socklen_t sockaddrlen;
unsigned char d1, d2, d3, d4;
char abuf[INET6_ADDRSTRLEN];
#endif