diff options
author | pst <pst@FreeBSD.org> | 1998-02-03 20:53:25 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1998-02-03 20:53:25 +0000 |
commit | 4b6990082a952a76bf52f34caaf2433a88514ada (patch) | |
tree | 6fb549340725cbc86f3d6a8d2b00b72f362f2d73 /usr.bin/ftp/util.c | |
parent | ee765b7a8622e8ebd918673df02b6e931a314103 (diff) | |
download | FreeBSD-src-4b6990082a952a76bf52f34caaf2433a88514ada.zip FreeBSD-src-4b6990082a952a76bf52f34caaf2433a88514ada.tar.gz |
Don't print garbage when user enters EOF at name prompt.
PR: 5565
Submitted by: Jens Schweikhardt
Diffstat (limited to 'usr.bin/ftp/util.c')
-rw-r--r-- | usr.bin/ftp/util.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index 08111dd..67bfc24 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -1,4 +1,4 @@ -/* $Id: util.c,v 1.3 1997/12/13 20:38:21 pst Exp $ */ +/* $Id: util.c,v 1.4 1997/12/16 08:17:26 ache Exp $ */ /* $NetBSD: util.c,v 1.16.2.1 1997/11/18 01:02:33 mellon Exp $ */ /* @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$Id: util.c,v 1.3 1997/12/13 20:38:21 pst Exp $"); +__RCSID("$Id: util.c,v 1.4 1997/12/16 08:17:26 ache Exp $"); __RCSID_SOURCE("$NetBSD: util.c,v 1.16.2.1 1997/11/18 01:02:33 mellon Exp $"); #endif /* not lint */ @@ -258,7 +258,8 @@ login(host, user, pass) printf("Name (%s:%s): ", host, myname); else printf("Name (%s): ", host); - (void)fgets(tmp, sizeof(tmp) - 1, stdin); + if (fgets(tmp, sizeof(tmp) - 1, stdin) == NULL) + return (0); tmp[strlen(tmp) - 1] = '\0'; if (*tmp == '\0') user = myname; |