From b9600b6040035f681b83eda8979335c946311ee1 Mon Sep 17 00:00:00 2001 From: kris Date: Sun, 19 Nov 2000 10:01:27 +0000 Subject: Don't use sizeof() on a pointer when we really wanted to measure the length of the array. Noticed by: Christos Zoulas Obtained from: OpenBSD --- libexec/telnetd/ext.h | 2 +- libexec/telnetd/sys_term.c | 10 +++------- libexec/telnetd/telnetd.c | 1 - 3 files changed, 4 insertions(+), 9 deletions(-) (limited to 'libexec/telnetd') diff --git a/libexec/telnetd/ext.h b/libexec/telnetd/ext.h index bce0e2a..98e74b7 100644 --- a/libexec/telnetd/ext.h +++ b/libexec/telnetd/ext.h @@ -87,7 +87,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 */ #ifndef P diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c index 332dddc..306449a 100644 --- a/libexec/telnetd/sys_term.c +++ b/libexec/telnetd/sys_term.c @@ -480,14 +480,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 9158dfb..7216cf7 100644 --- a/libexec/telnetd/telnetd.c +++ b/libexec/telnetd/telnetd.c @@ -805,7 +805,6 @@ doit(who) #else for (;;) { char *lp; - extern char *line, *getpty(); if ((lp = getpty()) == NULL) fatal(net, "Out of ptys"); -- cgit v1.1