Browse Source

Merge f76c46565a into db232808aa

pull/2978/merge
Fedor Kallay 1 day ago
committed by GitHub
parent
commit
6755e50fa6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      examples/simple_repeater/main.cpp
  2. 2
      examples/simple_room_server/main.cpp
  3. 2
      examples/simple_secure_chat/main.cpp
  4. 2
      examples/simple_sensor/main.cpp

2
examples/simple_repeater/main.cpp

@ -135,7 +135,7 @@ void loop() {
if (c == '\r') break;
}
if (len == sizeof(command)-1) { // command buffer full
command[sizeof(command)-1] = '\r';
command[sizeof(command)-2] = '\r'; // force-complete the line ([len-1] is tested below; [sizeof-1] would clobber the NUL and never match)
}
if (len > 0 && command[len - 1] == '\r') { // received complete line

2
examples/simple_room_server/main.cpp

@ -114,7 +114,7 @@ void loop() {
Serial.print(c);
}
if (len == sizeof(command)-1) { // command buffer full
command[sizeof(command)-1] = '\r';
command[sizeof(command)-2] = '\r'; // force-complete the line ([len-1] is tested below; [sizeof-1] would clobber the NUL and never match)
}
if (len > 0 && command[len - 1] == '\r') { // received complete line

2
examples/simple_secure_chat/main.cpp

@ -535,7 +535,7 @@ public:
Serial.print(c);
}
if (len == sizeof(command)-1) { // command buffer full
command[sizeof(command)-1] = '\r';
command[sizeof(command)-2] = '\r'; // force-complete the line ([len-1] is tested below; [sizeof-1] would clobber the NUL and never match)
}
if (len > 0 && command[len - 1] == '\r') { // received complete line

2
examples/simple_sensor/main.cpp

@ -131,7 +131,7 @@ void loop() {
Serial.print(c);
}
if (len == sizeof(command)-1) { // command buffer full
command[sizeof(command)-1] = '\r';
command[sizeof(command)-2] = '\r'; // force-complete the line ([len-1] is tested below; [sizeof-1] would clobber the NUL and never match)
}
if (len > 0 && command[len - 1] == '\r') { // received complete line

Loading…
Cancel
Save