From 9bc7be0d9a52edf77cf65554bce8a43123953107 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Thu, 18 Aug 2011 15:13:47 -0400 Subject: Stream.readBytesUntil() now writes null terminator within length. --- cores/arduino/Stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cores') 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 ! -- cgit v1.2.3-18-g5258