=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/telnet/telnet.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/telnet/telnet.c 1995/10/18 08:46:15 1.1 --- src/usr.bin/telnet/telnet.c 1996/03/27 19:33:10 1.2 *************** *** 1,3 **** --- 1,6 ---- + /* $OpenBSD: telnet.c,v 1.2 1996/03/27 19:33:10 niklas Exp $ */ + /* $NetBSD: telnet.c,v 1.7 1996/02/28 21:04:15 thorpej Exp $ */ + /* * Copyright (c) 1988, 1990, 1993 * The Regents of the University of California. All rights reserved. *************** *** 32,39 **** */ #ifndef lint ! /* from: static char sccsid[] = "@(#)telnet.c 8.1 (Berkeley) 6/6/93"; */ ! static char *rcsid = "$Id: telnet.c,v 1.1 1995/10/18 08:46:15 deraadt Exp $"; #endif /* not lint */ #include --- 35,46 ---- */ #ifndef lint ! #if 0 ! static char sccsid[] = "@(#)telnet.c 8.4 (Berkeley) 5/30/95"; ! static char rcsid[] = "$NetBSD: telnet.c,v 1.7 1996/02/28 21:04:15 thorpej Exp $"; ! #else ! static char rcsid[] = "$OpenBSD: telnet.c,v 1.2 1996/03/27 19:33:10 niklas Exp $"; ! #endif #endif /* not lint */ #include *************** *** 58,64 **** #include "general.h" ! #define strip(x) ((x)&0x7f) static unsigned char subbuffer[SUBBUFSIZE], *subpointer, *subend; /* buffer for sub-options */ --- 65,71 ---- #include "general.h" ! #define strip(x) ((my_want_state_is_wont(TELOPT_BINARY)) ? ((x)&0x7f) : (x)) static unsigned char subbuffer[SUBBUFSIZE], *subpointer, *subend; /* buffer for sub-options */ *************** *** 179,185 **** ClearArray(options); connected = In3270 = ISend = localflow = donebinarytoggle = 0; ! #if defined(AUTHENTICATION) auth_encrypt_connect(connected); #endif /* defined(AUTHENTICATION) */ restartany = -1; --- 186,192 ---- ClearArray(options); connected = In3270 = ISend = localflow = donebinarytoggle = 0; ! #if defined(AUTHENTICATION) auth_encrypt_connect(connected); #endif /* defined(AUTHENTICATION) */ restartany = -1; *************** *** 615,621 **** register char c, *cp, **argvp, *cp2, **argv, **avt; if (name) { ! if (strlen(name) > 40) { name = 0; unknown[0] = name_unknown; } else { --- 622,628 ---- register char c, *cp, **argvp, *cp2, **argv, **avt; if (name) { ! if ((int)strlen(name) > 40) { name = 0; unknown[0] = name_unknown; } else { *************** *** 681,687 **** else if (islower(c)) *cp = toupper(c); } ! /* * Check for an old V6 2 character name. If the second * name points to the beginning of the buffer, and is --- 688,694 ---- else if (islower(c)) *cp = toupper(c); } ! /* * Check for an old V6 2 character name. If the second * name points to the beginning of the buffer, and is *************** *** 774,780 **** (setupterm(tname, 1, &err) == 0)) { tnamep = mklist(termbuf, tname); } else { ! if (tname && (strlen(tname) <= 40)) { unknown[0] = tname; upcase(tname); } else --- 781,787 ---- (setupterm(tname, 1, &err) == 0)) { tnamep = mklist(termbuf, tname); } else { ! if (tname && ((int)strlen(tname) <= 40)) { unknown[0] = tname; upcase(tname); } else *************** *** 1749,1755 **** case TS_IAC: process_iac: switch (c) { ! case WILL: telrcv_state = TS_WILL; continue; --- 1756,1762 ---- case TS_IAC: process_iac: switch (c) { ! case WILL: telrcv_state = TS_WILL; continue; *************** *** 2135,2141 **** ring_full_consecutive(&ttyiring)); if (c) { returnValue = 1; ! ring_consumed(&ttyiring, c); } } else { # endif /* defined(TN3270) */ --- 2142,2148 ---- ring_full_consecutive(&ttyiring)); if (c) { returnValue = 1; ! ring_consumed(&ttyiring, c); } } else { # endif /* defined(TN3270) */ *************** *** 2164,2170 **** { sys_telnet_init(); ! #if defined(AUTHENTICATION) { static char local_host[256] = { 0 }; --- 2171,2177 ---- { sys_telnet_init(); ! #if defined(AUTHENTICATION) { static char local_host[256] = { 0 }; *************** *** 2342,2348 **** next = nextitem(next); } while (wewant(next) && (nfrontp > next)); length = next-thisitem; ! memcpy(good, thisitem, length); good += length; thisitem = next; } else { --- 2349,2355 ---- next = nextitem(next); } while (wewant(next) && (nfrontp > next)); length = next-thisitem; ! memmove(good, thisitem, length); good += length; thisitem = next; } else {