Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/libexec/telnetd Pull up revision 1.26 (requested by lha i...



details:   https://anonhg.NetBSD.org/src/rev/cd453297fc0d
branches:  netbsd-3
changeset: 576326:cd453297fc0d
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jun 27 09:20:26 2005 +0000

description:
Pull up revision 1.26 (requested by lha in ticket #502):
Remove static local variable so its easier to correctly use strlcpy.

diffstat:

 libexec/telnetd/state.c |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (52 lines):

diff -r dd155eff4280 -r cd453297fc0d libexec/telnetd/state.c
--- a/libexec/telnetd/state.c   Mon Jun 27 09:20:19 2005 +0000
+++ b/libexec/telnetd/state.c   Mon Jun 27 09:20:26 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: state.c,v 1.25 2005/02/06 05:58:21 perry Exp $ */
+/*     $NetBSD: state.c,v 1.25.2.1 2005/06/27 09:20:26 tron Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)state.c    8.5 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: state.c,v 1.25 2005/02/06 05:58:21 perry Exp $");
+__RCSID("$NetBSD: state.c,v 1.25.2.1 2005/06/27 09:20:26 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -1140,7 +1140,7 @@
     }  /* end of case TELOPT_TSPEED */
 
     case TELOPT_TTYPE: {               /* Yaaaay! */
-       static char terminalname[41];
+       char *p;
 
        if (his_state_is_wont(TELOPT_TTYPE))    /* Ignore if option disabled */
                break;
@@ -1150,9 +1150,9 @@
            return;             /* ??? XXX but, this is the most robust */
        }
 
-       terminaltype = terminalname;
+       p = terminaltype;
 
-       while ((terminaltype < (terminalname + sizeof terminalname-1)) &&
+       while ((p < (terminaltype + sizeof terminaltype-1)) &&
                                                                    !SB_EOF()) {
            int c;
 
@@ -1160,10 +1160,9 @@
            if (isupper(c)) {
                c = tolower(c);
            }
-           *terminaltype++ = c;    /* accumulate name */
+           *p++ = c;    /* accumulate name */
        }
-       *terminaltype = 0;
-       terminaltype = terminalname;
+       *p = 0;
        break;
     }  /* end of case TELOPT_TTYPE */
 



Home | Main Index | Thread Index | Old Index