is handled; comment was "Don't do CR-NUL if we are in binary mode"
SCCS-vsn: libexec/telnetd/telnetd.c 5.19
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)telnetd.c 5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnetd.c 5.19 (Berkeley) %G%";
if (c == IAC)
*nfrontp++ = c;
*nfrontp++ = c;
if (c == IAC)
*nfrontp++ = c;
*nfrontp++ = c;
+ /* Don't do CR-NUL if we are in binary mode */
+ if ((c == '\r') && (myopts[TELOPT_BINARY] == OPT_NO)) {
if (pcc > 0 && ((*ptyip & 0377) == '\n')) {
*nfrontp++ = *ptyip++ & 0377;
pcc--;
if (pcc > 0 && ((*ptyip & 0377) == '\n')) {
*nfrontp++ = *ptyip++ & 0377;
pcc--;
* unix way of saying that (\r is only good
* if CRMOD is set, which it normally is).
*/
* unix way of saying that (\r is only good
* if CRMOD is set, which it normally is).
*/
- if ((myopts[TELOPT_BINARY] == OPT_NO) && c == '\r') {
+ if ((c == '\r') && (hisopts[TELOPT_BINARY] == OPT_NO)) {
if ((ncc > 0) && ('\n' == *netip)) {
netip++; ncc--;
c = '\n';
if ((ncc > 0) && ('\n' == *netip)) {
netip++; ncc--;
c = '\n';