aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/telnet.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/networking/telnet.c b/networking/telnet.c
index 58a691916..a25579773 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -125,12 +125,10 @@ static void subneg(byte c);
125 125
126static void iac_flush(void) 126static void iac_flush(void)
127{ 127{
128 write(netfd, G.iacbuf, G.iaclen); 128 full_write(netfd, G.iacbuf, G.iaclen);
129 G.iaclen = 0; 129 G.iaclen = 0;
130} 130}
131 131
132#define write_str(fd, str) write(fd, str, sizeof(str) - 1)
133
134static void doexit(int ev) NORETURN; 132static void doexit(int ev) NORETURN;
135static void doexit(int ev) 133static void doexit(int ev)
136{ 134{
@@ -145,7 +143,7 @@ static void con_escape(void)
145 if (bb_got_signal) /* came from line mode... go raw */ 143 if (bb_got_signal) /* came from line mode... go raw */
146 rawmode(); 144 rawmode();
147 145
148 write_str(1, "\r\nConsole escape. Commands are:\r\n\n" 146 full_write1_str("\r\nConsole escape. Commands are:\r\n\n"
149 " l go to line mode\r\n" 147 " l go to line mode\r\n"
150 " c go to character mode\r\n" 148 " c go to character mode\r\n"
151 " z suspend telnet\r\n" 149 " z suspend telnet\r\n"
@@ -176,7 +174,7 @@ static void con_escape(void)
176 doexit(EXIT_SUCCESS); 174 doexit(EXIT_SUCCESS);
177 } 175 }
178 176
179 write_str(1, "continuing...\r\n"); 177 full_write1_str("continuing...\r\n");
180 178
181 if (bb_got_signal) 179 if (bb_got_signal)
182 cookmode(); 180 cookmode();
@@ -383,10 +381,11 @@ static void put_iac_naws(byte c, int x, int y)
383 put_iac(SB); 381 put_iac(SB);
384 put_iac(c); 382 put_iac(c);
385 383
386 put_iac((x >> 8) & 0xff); 384 /* "... & 0xff" implicitly done below */
387 put_iac(x & 0xff); 385 put_iac(x >> 8);
388 put_iac((y >> 8) & 0xff); 386 put_iac(x);
389 put_iac(y & 0xff); 387 put_iac(y >> 8);
388 put_iac(y);
390 389
391 put_iac(IAC); 390 put_iac(IAC);
392 put_iac(SE); 391 put_iac(SE);