diff --git a/cores/esp8266/Stream.h b/cores/esp8266/Stream.h index 6408befe02..1dd2ee24a6 100644 --- a/cores/esp8266/Stream.h +++ b/cores/esp8266/Stream.h @@ -61,6 +61,7 @@ class Stream: public Print { virtual int peek() = 0; Stream() {} + virtual ~Stream() {} // parsing methods diff --git a/cores/esp8266/StreamDev.h b/cores/esp8266/StreamDev.h index b61a0df55a..2aeee4c87a 100644 --- a/cores/esp8266/StreamDev.h +++ b/cores/esp8266/StreamDev.h @@ -160,6 +160,7 @@ class StreamConstPtr: public StreamNull size_t _peekPointer = 0; public: + StreamConstPtr(const String&& string) = delete; // prevents passing String temporary, use ctor(buffer,size) if you know what you are doing StreamConstPtr(const String& string): _buffer(string.c_str()), _size(string.length()), _byteAddressable(true) { } StreamConstPtr(const char* buffer, size_t size): _buffer(buffer), _size(size), _byteAddressable(__byteAddressable(buffer)) { } StreamConstPtr(const uint8_t* buffer, size_t size): _buffer((const char*)buffer), _size(size), _byteAddressable(__byteAddressable(buffer)) { } diff --git a/cores/esp8266/StreamSend.cpp b/cores/esp8266/StreamSend.cpp index c351575463..693e340cff 100644 --- a/cores/esp8266/StreamSend.cpp +++ b/cores/esp8266/StreamSend.cpp @@ -341,7 +341,7 @@ Stream& operator << (Stream& out, Stream& stream) Stream& operator << (Stream& out, const char* text) { - StreamConstPtr(text).sendAll(out); + StreamConstPtr(text, strlen_P(text)).sendAll(out); return out; }