LennartHennigs/ESPTelnet

Telnet.println only sends a new line ... no carriage return

JMWilton opened this issue · 1 comments

Telnet.println only sends a new line not a new line and carriage return. Looking at the source code it appears that client.print is being called with a "\n" being appended to the string. It is not clear why client.println is not called instead. I assume this would also send the appropriate carriage return. I do understand that I can manually append a "\r" to each string before calling telnet.println. My expectation is that println should send both carriage return and new line characters.

/* ------------------------------------------------- */

void ESPTelnet::println(String str) {
client.print(str + "\n");
}

/* ------------------------------------------------- */

void ESPTelnet::println(char c) {
client.print(c + "\n");
}

/* ------------------------------------------------- */

void ESPTelnet::println() {
client.print("\n");
}

Hey, thank you for pointing this out. I actually don't know why I did not use println() in the first place.
Will fix it.