Stream.readBytesUntil() now writes null terminator within length.

This commit is contained in:
David A. Mellis 2011-08-18 15:13:47 -04:00
parent 8dd6a40334
commit 9bc7be0d9a
1 changed files with 1 additions and 1 deletions

View File

@ -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 !