Skip to content

Commit 4b0a87b

Browse files
committed
Stream.readBytesUntil() now writes null terminator within length.
1 parent ac3f093 commit 4b0a87b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hardware/arduino/cores/arduino/Stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ int Stream::readBytesUntil( char terminator, char *buffer, size_t length)
214214
{
215215
int index = 0;
216216
*buffer = 0;
217-
while(index < length ){
217+
while(index < length-1 ){
218218
int c = timedRead();
219219
if( c <= 0 ){
220220
return 0; // timeout returns 0 !

0 commit comments

Comments
 (0)