# HG changeset patch # User Hasan Yavuz Ă–ZDERYA # Date 2016-06-14 15:47:37 # Node ID 934c1d1050b2b986d1d7d8be0068d4b3bae349c6 # Parent fa8cb0995e3eefa8ec7005cd439cb81b94b5b795 solve data parsing errors when opening pseudo terminals diff --git a/src/asciireader.cpp b/src/asciireader.cpp --- a/src/asciireader.cpp +++ b/src/asciireader.cpp @@ -88,6 +88,15 @@ void AsciiReader::onDataReady() // parse data line = line.trimmed(); + + // Note: When data coming from pseudo terminal is buffered by + // system CR is converted to LF for some reason. This causes + // empty lines in the input when the port is just opened. + if (line.isEmpty()) + { + continue; + } + auto separatedValues = line.split(','); int numReadChannels; // effective number of channels to read