diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2011-08-18 15:13:47 -0400 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2011-08-18 15:13:47 -0400 |
commit | 9bc7be0d9a52edf77cf65554bce8a43123953107 (patch) | |
tree | adfb082742bc3e9ae3c58443f926a26b797c827a /cores/arduino/Stream.cpp | |
parent | 8dd6a40334613ce1c0c575a93bcd86ee1b109be6 (diff) |
Stream.readBytesUntil() now writes null terminator within length.
Diffstat (limited to 'cores/arduino/Stream.cpp')
-rw-r--r-- | cores/arduino/Stream.cpp | 2 |
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 ! |