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:
raiden00pl 2026-10-07 16:09:47 +02:00 • committed by Xiang Xiao
parent 35e0427bef
commit 9f52373558

View file

@ -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;
}