diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-06-11 09:03:33 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-06-11 09:03:33 +0000 |
commit | 548b17c1b4b9a7cf462d10ebab9b3ca7b48cacbc (patch) | |
tree | 46bcd32b4d664ff8e0aadfb1de300c1366d0071c /usr.bin/ftp | |
parent | 747e5a0481b779e30de867dd6c5beb8030b4d351 (diff) |
do not add empty lines to history; always check the size of the returned
string by el_gets.
Diffstat (limited to 'usr.bin/ftp')
-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; } |