SCCS-vsn: libexec/telnetd/telnetd.c 5.35
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)telnetd.c 5.34 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnetd.c 5.35 (Berkeley) %G%";
* getterminalspeed
*
* Ask the other end to send along its terminal speed.
* getterminalspeed
*
* Ask the other end to send along its terminal speed.
- * subopt does the rest. Interlocked so it can't happen during
- * getterminaltype.
+ * subopt does the rest.
}
case TELOPT_NAWS: {
struct winsize win;
}
case TELOPT_NAWS: {
struct winsize win;
- char c;
-
-#define SB_GETCHAR(c) \
- { if ((c = SB_GET()) == IAC && SB_GET() != IAC) return; }
ioctl(pty, TIOCGWINSZ, &win);
settimer(ttypesubopt);
syslog(LOG_INFO, "%x %x %x %x",
subpointer[0],subpointer[1],subpointer[2],subpointer[3]);
ioctl(pty, TIOCGWINSZ, &win);
settimer(ttypesubopt);
syslog(LOG_INFO, "%x %x %x %x",
subpointer[0],subpointer[1],subpointer[2],subpointer[3]);
- SB_GETCHAR(c);
- win.ws_col = c << 8;
- SB_GETCHAR(c);
- win.ws_col |= c;
- SB_GETCHAR(c);
- win.ws_row = c << 8;
- SB_GETCHAR(c);
- win.ws_row |= c;
+ win.ws_col = SB_GET() << 8;
+ win.ws_col |= SB_GET();
+ win.ws_row = SB_GET() << 8;
+ win.ws_row |= SB_GET();
syslog(LOG_INFO, "col %d row %d", win.ws_col, win.ws_row);
ioctl(pty, TIOCSWINSZ, &win);
break;
syslog(LOG_INFO, "col %d row %d", win.ws_col, win.ws_row);
ioctl(pty, TIOCSWINSZ, &win);
break;