diff options
author | ru <ru@FreeBSD.org> | 2000-06-24 15:34:31 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2000-06-24 15:34:31 +0000 |
commit | f86fac3085989f9da9b6412106f428dd3138c544 (patch) | |
tree | afa1a1b1f126ea13d9b0181dc79b697b1170f290 /usr.bin/ftp | |
parent | 659df59b0e36fdcc741f84bef9a6c11908fa5a42 (diff) | |
download | FreeBSD-src-f86fac3085989f9da9b6412106f428dd3138c544.zip FreeBSD-src-f86fac3085989f9da9b6412106f428dd3138c544.tar.gz |
- Reflect `gateport' variable type change.
- Make it compile with -Wall.
PR: 18619
Submitted by: David Malone <dwmalone@maths.tcd.ie>
Reviewed by: ru
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r-- | usr.bin/ftp/cmds.c | 12 | ||||
-rw-r--r-- | usr.bin/ftp/fetch.c | 2 | ||||
-rw-r--r-- | usr.bin/ftp/ftp.c | 4 | ||||
-rw-r--r-- | usr.bin/ftp/ftp_var.h | 1 | ||||
-rw-r--r-- | usr.bin/ftp/main.c | 9 |
5 files changed, 16 insertions, 12 deletions
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index 9da2a84..2b63302 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -657,8 +657,8 @@ status(argc, argv) } pswitch(0); } - printf("Gate ftp: %s, server %s, port %d.\n", onoff(gatemode), - *gateserver ? gateserver : "(none)", ntohs(gateport)); + printf("Gate ftp: %s, server %s, port %s.\n", onoff(gatemode), + *gateserver ? gateserver : "(none)", gateport); printf("Passive mode: %s.\n", onoff(passivemode)); printf("Mode: %s; Type: %s; Form: %s; Structure: %s.\n", modename, typename, formname, structname); @@ -889,7 +889,9 @@ setgate(argc, argv) code = -1; return; } - gateport = htons(port); + if (gateport != NULL) + free(gateport); + asprintf(&gateport, "%ld", port); } strncpy(gsbuf, argv[1], sizeof(gsbuf) - 1); gsbuf[sizeof(gsbuf) - 1] = '\0'; @@ -902,8 +904,8 @@ setgate(argc, argv) "Disabling gate-ftp mode - no gate-ftp server defined.\n"); gatemode = 0; } else { - printf("Gate ftp: %s, server %s, port %d.\n", onoff(gatemode), - *gateserver ? gateserver : "(none)", ntohs(gateport)); + printf("Gate ftp: %s, server %s, port %s.\n", onoff(gatemode), + *gateserver ? gateserver : "(none)", gateport); } code = gatemode; } diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index 0643e5d..ae5a2fa 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -114,10 +114,12 @@ url_get(origline, proxyenv) s = -1; proxy = NULL; isftpurl = 0; + res0 = NULL; #ifdef __GNUC__ /* XXX: to shut up gcc warnings */ (void)&savefile; (void)&proxy; + (void)&res0; #endif line = strdup(origline); diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c index 8d38669..1862333 100644 --- a/usr.bin/ftp/ftp.c +++ b/usr.bin/ftp/ftp.c @@ -1178,6 +1178,9 @@ initconn() #endif if (passivemode) { +#ifdef __GNUC__ /* XXX: to shut up gcc warnings */ + (void)&pasvcmd; +#endif data_addr = myctladdr; data = socket(data_addr.su_family, SOCK_STREAM, 0); if (data < 0) { @@ -1327,7 +1330,6 @@ initconn() } } else if (strcmp(pasvcmd, "EPSV") == 0) { char delim[4]; - char *tcpport; prt[0] = 0; if (code / 10 == 22 && code != 229) { diff --git a/usr.bin/ftp/ftp_var.h b/usr.bin/ftp/ftp_var.h index 75cb5da..c13b32c 100644 --- a/usr.bin/ftp/ftp_var.h +++ b/usr.bin/ftp/ftp_var.h @@ -45,6 +45,7 @@ #include <setjmp.h> #include <stringlist.h> #include <netinet/in.h> +#include <netdb.h> #ifndef SMALL #include <histedit.h> diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index f38d3b0..dd1f210 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -79,11 +79,9 @@ main(argc, argv) int argc; char *argv[]; { - struct servent *sp; int ch, top, rval; - long port; struct passwd *pw = NULL; - char *cp, *ep, homedir[MAXPATHLEN], *s; + char *cp, homedir[MAXPATHLEN], *s; int dumbterm; char *src_addr = NULL; @@ -94,9 +92,9 @@ main(argc, argv) gateport = NULL; cp = getenv("FTPSERVERPORT"); if (cp != NULL) - gateport = cp; + asprintf(&gateport, "%s", cp); if (!gateport) - gateport = "ftpgate"; + asprintf(&gateport, "ftpgate"); doglob = 1; interactive = 1; autologin = 1; @@ -234,7 +232,6 @@ main(argc, argv) if (dobind) { struct addrinfo hints; struct addrinfo *res; - char *ftpdataport = "ftp-data"; int error; memset(&hints, 0, sizeof(hints)); |