aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/appl/telnet/telnet/telnet.c
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>2001-03-04 13:29:36 +0000
committerMark Murray <markm@FreeBSD.org>2001-03-04 13:29:36 +0000
commitf64561b7956bf35823e05914010fbe596119e214 (patch)
tree9c9106aadf7ae3d0d4608bdd6249a30226682168 /crypto/heimdal/appl/telnet/telnet/telnet.c
parent5550d6099cf38ab639ef5363e3284e314bb64e41 (diff)
downloadsrc-f64561b7956bf35823e05914010fbe596119e214.tar.gz
src-f64561b7956bf35823e05914010fbe596119e214.zip
MFC: Heimdal 0.3e (MIT mucho-compatible) upgrade.
Notes
Notes: svn path=/stable/4/; revision=73518
Diffstat (limited to 'crypto/heimdal/appl/telnet/telnet/telnet.c')
-rw-r--r--crypto/heimdal/appl/telnet/telnet/telnet.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/crypto/heimdal/appl/telnet/telnet/telnet.c b/crypto/heimdal/appl/telnet/telnet/telnet.c
index 792f018935d0..e705a7babf40 100644
--- a/crypto/heimdal/appl/telnet/telnet/telnet.c
+++ b/crypto/heimdal/appl/telnet/telnet/telnet.c
@@ -36,7 +36,7 @@
#include <termcap.h>
#endif
-RCSID("$Id: telnet.c,v 1.27 2000/01/01 11:53:24 assar Exp $");
+RCSID("$Id: telnet.c,v 1.28 2000/11/08 17:32:43 joda Exp $");
#define strip(x) (eight ? (x) : ((x) & 0x7f))
@@ -637,15 +637,21 @@ static char termbuf[1024];
static int
telnet_setupterm(const char *tname, int fd, int *errp)
{
- if (tgetent(termbuf, tname) == 1) {
- termbuf[1023] = '\0';
- if (errp)
- *errp = 1;
- return(0);
- }
+#ifdef HAVE_TGETENT
+ if (tgetent(termbuf, tname) == 1) {
+ termbuf[1023] = '\0';
if (errp)
- *errp = 0;
- return(-1);
+ *errp = 1;
+ return(0);
+ }
+ if (errp)
+ *errp = 0;
+ return(-1);
+#else
+ strlcpy(termbuf, tname, sizeof(termbuf));
+ if(errp) *errp = 1;
+ return 0;
+#endif
}
int resettermname = 1;