summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-11-16 19:00:20 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-11-16 19:00:20 +0000
commit62d33ddaf2943cd1e6155c0af1d4a7c6d3c494e6 (patch)
treecaa62868e33bb65438db22b2ec8108932f1ddfcf
parentaa4345d1f34ebdabce4ba0aa5c302bce54c72da9 (diff)
Don't use sizeof() a pointer as a length parameter. This change makes
'line' from sys_term.c from a char * into a char array. There's no need to explicitly initialize the contents to 0 since that happens for globals anyway.
-rw-r--r--libexec/telnetd/ext.h4
-rw-r--r--libexec/telnetd/sys_term.c14
-rw-r--r--libexec/telnetd/telnetd.c5
3 files changed, 9 insertions, 14 deletions
diff --git a/libexec/telnetd/ext.h b/libexec/telnetd/ext.h
index 43836100773..774902fc8c8 100644
--- a/libexec/telnetd/ext.h
+++ b/libexec/telnetd/ext.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext.h,v 1.8 1998/07/28 20:18:19 marc Exp $ */
+/* $OpenBSD: ext.h,v 1.9 2000/11/16 19:00:19 millert Exp $ */
/* $NetBSD: ext.h,v 1.6 1996/02/28 20:38:13 thorpej Exp $ */
/*
@@ -86,7 +86,7 @@ extern char *unptyip; /* pointer to remaining characters in buffer */
#endif
extern int pty, net;
-extern char *line;
+extern char line[16];
extern int SYNCHing; /* we are in TELNET SYNCH mode */
#include <sys/cdefs.h>
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c
index 8978581f814..56f1f43e449 100644
--- a/libexec/telnetd/sys_term.c
+++ b/libexec/telnetd/sys_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_term.c,v 1.20 2000/10/10 12:59:46 millert Exp $ */
+/* $OpenBSD: sys_term.c,v 1.21 2000/11/16 19:00:19 millert Exp $ */
/* $NetBSD: sys_term.c,v 1.9 1996/03/20 04:25:53 tls Exp $ */
/*
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: sys_term.c,v 1.8 1996/02/28 20:38:21 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: sys_term.c,v 1.20 2000/10/10 12:59:46 millert Exp $";
+static char rcsid[] = "$OpenBSD: sys_term.c,v 1.21 2000/11/16 19:00:19 millert Exp $";
#endif
#endif /* not lint */
@@ -474,14 +474,10 @@ getnpty()
*
* Returns the file descriptor of the opened pty.
*/
-#ifndef __GNUC__
-char *line = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-#else
-static char Xline[] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-char *line = Xline;
-#endif
#ifdef CRAY
-char *myline = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+char myline[16];
+#else
+char line[16];
#endif /* CRAY */
int
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c
index 0593ea79322..bf551d92bca 100644
--- a/libexec/telnetd/telnetd.c
+++ b/libexec/telnetd/telnetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: telnetd.c,v 1.26 2000/10/24 21:52:37 millert Exp $ */
+/* $OpenBSD: telnetd.c,v 1.27 2000/11/16 19:00:19 millert Exp $ */
/* $NetBSD: telnetd.c,v 1.6 1996/03/20 04:25:57 tls Exp $ */
/*
@@ -45,7 +45,7 @@ static char copyright[] =
static char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: telnetd.c,v 1.5 1996/02/28 20:38:23 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: telnetd.c,v 1.26 2000/10/24 21:52:37 millert Exp $";
+static char rcsid[] = "$OpenBSD: telnetd.c,v 1.27 2000/11/16 19:00:19 millert Exp $";
#endif
#endif /* not lint */
@@ -817,7 +817,6 @@ doit(who)
#else
for (;;) {
char *lp;
- extern char *line, *getpty();
if ((lp = getpty()) == NULL)
fatal(net, "Out of ptys");