diff options
Diffstat (limited to 'cores')
-rw-r--r-- | cores/arduino/Print.cpp | 2 | ||||
-rw-r--r-- | cores/arduino/Stream.h | 3 | ||||
-rw-r--r-- | cores/arduino/WString.cpp | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/cores/arduino/Print.cpp b/cores/arduino/Print.cpp index 5a092af..652fed0 100644 --- a/cores/arduino/Print.cpp +++ b/cores/arduino/Print.cpp @@ -257,7 +257,7 @@ size_t Print::printFloat(double number, uint8_t digits) while (digits-- > 0) { remainder *= 10.0; - int toPrint = int(remainder); + unsigned int toPrint = (unsigned int)(remainder); n += print(toPrint); remainder -= toPrint; } diff --git a/cores/arduino/Stream.h b/cores/arduino/Stream.h index db71bb6..e4fd433 100644 --- a/cores/arduino/Stream.h +++ b/cores/arduino/Stream.h @@ -66,7 +66,8 @@ class Stream : public Print // parsing methods void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second - + unsigned long getTimeout(void) { return _timeout; } + bool find(char *target); // reads data from the stream until the target string is found bool find(uint8_t *target) { return find ((char *)target); } // returns true if target string is found, false if timed out (see setTimeout) diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index cd3e0e8..9975303 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -193,7 +193,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length) void String::move(String &rhs) { if (buffer) { - if (capacity >= rhs.len) { + if (rhs && capacity >= rhs.len) { strcpy(buffer, rhs.buffer); len = rhs.len; rhs.len = 0; |