mirror of
https://github.com/apache/nuttx.git
synced 2026-10-10 07:40:27 +00:00
drivers/net/telnet: Send CR LF as end of line.
telnet_putchar() appended the carriage return after the line feed, so every output line ended with LF CR. RFC 854 defines the telnet end of line as CR LF. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
parent
35e0427bef
commit
9f52373558
1 changed files with 6 additions and 6 deletions
|
|
@ -591,17 +591,14 @@ static bool telnet_putchar(FAR struct telnet_dev_s *priv, uint8_t ch,
|
|||
|
||||
if (ch != TELNET_CR)
|
||||
{
|
||||
/* Add all other characters to the destination buffer */
|
||||
|
||||
index = *nread;
|
||||
priv->td_txbuffer[index++] = ch;
|
||||
|
||||
/* Check for line feeds */
|
||||
/* Telnet end of line is CR LF (RFC 854): put the carriage return
|
||||
* before the line feed.
|
||||
*/
|
||||
|
||||
if (ch == TELNET_NL)
|
||||
{
|
||||
/* Now add the carriage return */
|
||||
|
||||
priv->td_txbuffer[index++] = TELNET_CR;
|
||||
|
||||
/* End of line */
|
||||
|
|
@ -609,6 +606,9 @@ static bool telnet_putchar(FAR struct telnet_dev_s *priv, uint8_t ch,
|
|||
ret = true;
|
||||
}
|
||||
|
||||
/* Add all other characters to the destination buffer */
|
||||
|
||||
priv->td_txbuffer[index++] = ch;
|
||||
*nread = index;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue