aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/Stream.cpp
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2011-08-18 15:13:47 -0400
committerDavid A. Mellis <d.mellis@arduino.cc>2011-08-18 15:13:47 -0400
commit9bc7be0d9a52edf77cf65554bce8a43123953107 (patch)
treeadfb082742bc3e9ae3c58443f926a26b797c827a /cores/arduino/Stream.cpp
parent8dd6a40334613ce1c0c575a93bcd86ee1b109be6 (diff)
Stream.readBytesUntil() now writes null terminator within length.
Diffstat (limited to 'cores/arduino/Stream.cpp')
-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 !