diff --git a/code/espurna/telnet.ino b/code/espurna/telnet.ino index 996da567..918f228e 100644 --- a/code/espurna/telnet.ino +++ b/code/espurna/telnet.ino @@ -67,8 +67,8 @@ void _telnetData(unsigned char clientId, void *data, size_t len) { // Capture close connection char * p = (char *) data; - // C-d is sent as two bytes - if (len == 2) { + // C-d is sent as two bytes (sometimes repeating) + if (len >= 2) { if ((p[0] == 0xFF) && (p[1] == 0xEC)) { _telnetClients[clientId]->close(); return;