summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-01-29 22:21:33 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-01-29 22:21:33 +0000
commiteaab01596434d7f6b53a768ae06297a14ed97a35 (patch)
tree9a3b34c5d4e68ad12ef6f352a8cc993d3fe95927 /usr.bin
parentb693436733a3c12253d11ac5378ab7844329d9f3 (diff)
Break out of infinite loop ftp://home.host/som/path mode if host
does not exist. Also, use herror, not perror if gethostbynam() fails.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ftp/http.c4
-rw-r--r--usr.bin/ftp/main.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/ftp/http.c b/usr.bin/ftp/http.c
index 36be1d9bdd1..69642d7a825 100644
--- a/usr.bin/ftp/http.c
+++ b/usr.bin/ftp/http.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: http.c,v 1.1 1996/09/03 18:00:06 deraadt Exp $ */
+/* $OpenBSD: http.c,v 1.2 1997/01/29 22:21:32 millert Exp $ */
/*
* Copyright (c) 1996 Theo de Raadt
@@ -104,7 +104,7 @@ http_fetch(url)
he = gethostbyname(hostname);
if (!he) {
- perror("gethostbyname");
+ herror("gethostbyname");
goto die;
}
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 44cd8e43611..a10adcc5303 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.15 1997/01/25 21:42:33 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.16 1997/01/29 22:21:32 millert Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.15 1997/01/25 21:42:33 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.16 1997/01/29 22:21:32 millert Exp $";
#endif
#endif /* not lint */
@@ -213,6 +213,8 @@ main(argc, argv)
if (!connected) {
printf("failed to connect to %s\n", host);
ret = 1;
+ argc--;
+ argv++;
goto bail;
}
*argv = p + 1;