summaryrefslogtreecommitdiff
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-11-02 01:51:34 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-11-02 01:51:34 +0000
commitc9a6c5971de9f9d47c31a36a71e69b08dcffcfc5 (patch)
tree9f6b713b530cc593ca70814995adba44c03fcbf9 /usr.bin/ftp
parent483854b412c06c0f061adb060bde17617770582a (diff)
Pass full buffer size to fgets.
OK moritz@ and jaredy@.
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/cmds.c6
-rw-r--r--usr.bin/ftp/util.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c
index f37acd35683..a1e5401fb59 100644
--- a/usr.bin/ftp/cmds.c
+++ b/usr.bin/ftp/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.53 2006/11/02 01:43:01 ray Exp $ */
+/* $OpenBSD: cmds.c,v 1.54 2006/11/02 01:51:33 ray Exp $ */
/* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */
/*
@@ -60,7 +60,7 @@
*/
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: cmds.c,v 1.53 2006/11/02 01:43:01 ray Exp $";
+static const char rcsid[] = "$OpenBSD: cmds.c,v 1.54 2006/11/02 01:51:33 ray Exp $";
#endif /* not lint and not SMALL */
/*
@@ -1275,7 +1275,7 @@ user(int argc, char *argv[])
(void)fputs("Account: ", ttyout);
(void)fflush(ttyout);
- if (fgets(acctname, sizeof(acctname) - 1, stdin) == NULL)
+ if (fgets(acctname, sizeof(acctname), stdin) == NULL)
goto fail;
if ((p = strchr(acctname, '\n')) != NULL)
*p = '\0';
diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c
index 17366d6b5d7..60c1e397f71 100644
--- a/usr.bin/ftp/util.c
+++ b/usr.bin/ftp/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.44 2006/11/02 01:43:01 ray Exp $ */
+/* $OpenBSD: util.c,v 1.45 2006/11/02 01:51:33 ray Exp $ */
/* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */
/*-
@@ -71,7 +71,7 @@
*/
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: util.c,v 1.44 2006/11/02 01:43:01 ray Exp $";
+static const char rcsid[] = "$OpenBSD: util.c,v 1.45 2006/11/02 01:51:33 ray Exp $";
#endif /* not lint and not SMALL */
/*
@@ -309,7 +309,7 @@ tryagain:
else
fprintf(ttyout, "Name (%s): ", host);
user = myname;
- if (fgets(tmp, sizeof(tmp) - 1, stdin) != NULL) {
+ if (fgets(tmp, sizeof(tmp), stdin) != NULL) {
char *p;
if ((p = strchr(tmp, '\n')) != NULL)