From 62d33ddaf2943cd1e6155c0af1d4a7c6d3c494e6 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 16 Nov 2000 19:00:20 +0000 Subject: 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. --- libexec/telnetd/ext.h | 4 ++-- libexec/telnetd/sys_term.c | 14 +++++--------- libexec/telnetd/telnetd.c | 5 ++--- 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 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"); -- cgit v1.2.3