static void iac_flush(void)
{
- write(netfd, G.iacbuf, G.iaclen);
+ full_write(netfd, G.iacbuf, G.iaclen);
G.iaclen = 0;
}
-#define write_str(fd, str) write(fd, str, sizeof(str) - 1)
-
static void doexit(int ev) NORETURN;
static void doexit(int ev)
{
if (bb_got_signal) /* came from line mode... go raw */
rawmode();
- write_str(1, "\r\nConsole escape. Commands are:\r\n\n"
+ full_write1_str("\r\nConsole escape. Commands are:\r\n\n"
" l go to line mode\r\n"
" c go to character mode\r\n"
" z suspend telnet\r\n"
doexit(EXIT_SUCCESS);
}
- write_str(1, "continuing...\r\n");
+ full_write1_str("continuing...\r\n");
if (bb_got_signal)
cookmode();
put_iac(SB);
put_iac(c);
- put_iac((x >> 8) & 0xff);
- put_iac(x & 0xff);
- put_iac((y >> 8) & 0xff);
- put_iac(y & 0xff);
+ /* "... & 0xff" implicitly done below */
+ put_iac(x >> 8);
+ put_iac(x);
+ put_iac(y >> 8);
+ put_iac(y);
put_iac(IAC);
put_iac(SE);