diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-10-24 21:52:39 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-10-24 21:52:39 +0000 |
commit | ebb351345004cbfdf8e2febba1b5048ffb224e38 (patch) | |
tree | f44ab14635fb5d1b004137446896a953052736ef /usr.bin | |
parent | b20e2335aef9c38d8580cc807ce37960701570c4 (diff) |
When calling setupterm() pass in an int* for the error code so
it doesn't spew to stderr if the terminal type can't be found.
Fix a logic thinko wrt terminaltypeok() -- it should return 0 on failure,
not success.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/telnet/telnet.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/telnet/telnet.c b/usr.bin/telnet/telnet.c index fc0e69114e2..dc0a1e79a7a 100644 --- a/usr.bin/telnet/telnet.c +++ b/usr.bin/telnet/telnet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: telnet.c,v 1.9 2000/10/10 15:41:11 millert Exp $ */ +/* $OpenBSD: telnet.c,v 1.10 2000/10/24 21:52:38 millert Exp $ */ /* $NetBSD: telnet.c,v 1.7 1996/02/28 21:04:15 thorpej Exp $ */ /* @@ -677,13 +677,14 @@ gettermname() char *tname; static char **tnamep = 0; static char **next; + int errret; if (resettermname) { resettermname = 0; if (tnamep && tnamep != unknown) free(tnamep); if ((tname = (char *)env_getvalue((unsigned char *)"TERM")) && - (setupterm(tname, 1, NULL) == OK)) { + (setupterm(tname, 1, &errret) == OK)) { tnamep = mklist(ttytype, tname); } else { if (tname && ((int)strlen(tname) <= 40)) { |