diff options
author | 2000-06-11 09:03:32 +0000 | |
---|---|---|
committer | 2000-06-11 09:03:32 +0000 | |
commit | 3fa16bb4e8eff79da097abf156029194aac8b010 (patch) | |
tree | 0df7b570950913b2dc6288d941003509cebace12 | |
parent | skeleton man page for ubsec (diff) | |
download | wireguard-openbsd-3fa16bb4e8eff79da097abf156029194aac8b010.tar.xz wireguard-openbsd-3fa16bb4e8eff79da097abf156029194aac8b010.zip |
do not add empty lines to history; always check the size of the returned
string by el_gets.
-rw-r--r-- | usr.bin/ftp/main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index aecaaa69cf0..73dc06ae729 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.45 2000/03/22 15:38:23 markus Exp $ */ +/* $OpenBSD: main.c,v 1.46 2000/06/11 09:03:32 fgsch Exp $ */ /* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */ /* @@ -73,7 +73,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.45 2000/03/22 15:38:23 markus Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.46 2000/06/11 09:03:32 fgsch Exp $"; #endif #endif /* not lint */ @@ -422,10 +422,11 @@ cmdscanner(top) if ((buf = el_gets(el, &num)) == NULL || num == 0) quit(0, 0); - if (line[--num] == '\n') { + if (buf[--num] == '\n') { if (num == 0) break; - } else if (num >= sizeof(line)) { + } + if (num >= sizeof(line)) { fputs("sorry, input line too long.\n", ttyout); break; } |