aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino')
-rw-r--r--cores/arduino/Stream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cores/arduino/Stream.cpp b/cores/arduino/Stream.cpp
index bf8304f..d267bf0 100644
--- a/cores/arduino/Stream.cpp
+++ b/cores/arduino/Stream.cpp
@@ -214,7 +214,7 @@ int Stream::readBytesUntil( char terminator, char *buffer, size_t length)
{
int index = 0;
*buffer = 0;
- while(index < length ){
+ while(index < length-1 ){
int c = timedRead();
if( c <= 0 ){
return 0; // timeout returns 0 !