Skip to content

Commit 65f50fc

Browse files
committed
Expand 'E' command error guarding to Space, as Windows clients seems to implicitly append whitespace or a newline and unnecessarily give their users migraines as a result
1 parent edb5377 commit 65f50fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

OpenFIREmain/OpenFIREserial.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ void OF_Serial::SerialProcessing()
270270
// Check to make sure that 'E' is not actually a glitched command bit
271271
// by ensuring that there's no adjacent bit.
272272
case 'E':
273-
if(Serial.peek() == -1) {
273+
// Either "no buffer" (-1) or any of the non-visual control bits, mainly Carriage Returns/Newlines
274+
// (as Windows sends these implicitly in `echo` commands by default)
275+
if(Serial.peek() <= 32) {
274276
if(!serialMode) Serial.println("SERIALREAD: Detected Serial End command while Serial Handoff mode is already off!");
275277
else {
276278
serialMode = false;

0 commit comments

Comments
 (0)