t3
Fork of C027_Support by
Diff: SerialPipe.cpp
- Revision:
- 12:684b31d5482b
- Parent:
- 11:b084552b03fe
- Child:
- 13:e2446fcdc246
diff -r b084552b03fe -r 684b31d5482b SerialPipe.cpp --- a/SerialPipe.cpp Thu Nov 14 15:52:36 2013 +0000 +++ b/SerialPipe.cpp Fri Nov 15 13:33:39 2013 +0000 @@ -86,8 +86,10 @@ i ++; if (t == '\r') // terminate commands with carriage return { - _pipeRx.done(); - return o; // if enter send the zero char + _pipeRx.done(); + if (s > o) + b[o] = '\0'; + return o; // if enter send the zero char } else if (t == '\n') // skip/filter new line /* skip */; @@ -97,5 +99,7 @@ o --; // remove it } o = 0; + if (s > 0) + b[0] = '\0'; return WAIT; }