Age | Commit message (Collapse) | Author |
|
|
|
Stream::find(char *target) passes NULL as “terminator” to Stream::findUntil(char *target, char *terminator), which immediately dereferences it by passing it on to strlen():
bool Stream::find(char *target)
{
return findUntil(target, NULL);
}
// as find but search ends if the terminator string is found
bool Stream::findUntil(char *target, char *terminator)
{
return findUntil(target, strlen(target), terminator, strlen(terminator));
}
|
|
peekNextDigit() returns an int, so it can return -1 in addition to all
256 possible bytes. By putting the result in a signe char, all bytes
over 128 will be interpreted as "no bytes available". Furthermore, it
seems that on SAM "char" is unsigned by default, causing the
"if (c < 0)" line a bit further down to always be false.
Using an int is more appropriate.
A different fix for this issue was suggested in #1399. This fix helps
towards #1728.
|
|
This isn't necessarily a particularly efficient implementation (it
allocates memory one character at a time and so may lead to
fragmentation) but it seems to work.
http://code.google.com/p/arduino/issues/detail?id=454
|
|
http://code.google.com/p/arduino/issues/detail?id=768
|
|
http://code.google.com/p/arduino/issues/detail?id=586
|
|
http://code.google.com/p/arduino/issues/detail?id=208
|
|
http://code.google.com/p/arduino/issues/detail?id=624
|
|
|
|
Renamed readChars() -> readBytes(), readCharsUntil() -> readBytesUntil().
Changed timeouts to milliseconds from seconds; default from 5 to 1 seconds.
Removed readCharsBetween().
|
|
This from Michael's TextFinder library, incorporated into the Stream class: find(), findUntil(), parseInt(), parseFloat(), readChars(), readCharsUntil(), readCharsBetween(), setTimeout().
|