diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-08-01 14:30:42 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-08-01 14:30:42 +0000 |
commit | ecd29a289a6ad8940e68b1ac989ff60d8d3532a7 (patch) | |
tree | e5575997a9a6fa7d08b8bd1aa25bcf7bf6df4972 | |
parent | e7d0af72e35f87da56b30dfba4e252ec91f30576 (diff) |
corrected some warnings
-rw-r--r-- | lib/ftp.c | 31 |
1 files changed, 4 insertions, 27 deletions
@@ -387,31 +387,6 @@ int Curl_GetFTPResponse(char *buf, return nread; /* total amount of bytes read */ } -#ifndef ENABLE_IPV6 -/* - * This function is only used by code that works on IPv4. When we add proper - * support for that functionality with IPv6, this function can go in again. - */ -/* -- who are we? -- */ -static char *getmyhost(char *buf, int buf_size) -{ -#if defined(HAVE_GETHOSTNAME) - gethostname(buf, buf_size); -#elif defined(HAVE_UNAME) - struct utsname ugnm; - strncpy(buf, uname(&ugnm) < 0 ? "localhost" : ugnm.nodename, buf_size - 1); - buf[buf_size - 1] = '\0'; -#else - /* We have no means of finding the local host name! */ - strncpy(buf, "localhost", buf_size); - buf[buf_size - 1] = '\0'; -#endif - return buf; -} - -#endif /* ipv4-only function */ - - /* ftp_connect() should do everything that is to be considered a part of the connection phase. */ CURLcode Curl_ftp_connect(struct connectdata *conn) @@ -1229,7 +1204,7 @@ CURLcode ftp_use_port(struct connectdata *conn) socklen_t sslen; sslen = sizeof(sa); - if (getsockname(conn->firstsocket, &sa, &sslen) < 0) { + if (getsockname(conn->firstsocket, (struct sockaddr *)&sa, &sslen) < 0) { failf(data, "getsockname() failed"); return CURLE_FTP_PORT_FAILED; } @@ -1299,7 +1274,9 @@ CURLcode ftp_use_port(struct connectdata *conn) struct in_addr in; unsigned short ip[5]; (void) memcpy(&in.s_addr, - h?*h->h_addr_list:&sa.sin_addr.s_addr, sizeof (in.s_addr)); + h?*h->h_addr_list:(char *)&sa.sin_addr.s_addr, + sizeof (in.s_addr)); + #ifdef HAVE_INET_NTOA_R /* ignore the return code from inet_ntoa_r() as it is int or char * depending on system */ |