From d69d6bfd5488847e775987f90c8ff1e97a77a2d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Mon, 22 Jan 2018 16:49:22 +0100 Subject: [PATCH] Skip first garbage message in telnet module --- code/espurna/telnet.ino | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/espurna/telnet.ino b/code/espurna/telnet.ino index f40818a9..1e62e215 100644 --- a/code/espurna/telnet.ino +++ b/code/espurna/telnet.ino @@ -49,6 +49,13 @@ unsigned char _telnetWrite(void *data, size_t len) { void _telnetData(unsigned char clientId, void *data, size_t len) { + // Skip first message since it's always garbage + static bool first = true; + if (first) { + first = false; + return; + } + // Capture close connection char * p = (char *) data; if ((strncmp(p, "close", 5) == 0) || (strncmp(p, "quit", 4) == 0)) {