1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-11 15:22:13 +03:00

StreamConstPtr: disallow passing a String temporary (#8410)

* StreamConstPtr: prevent from passing a temporary String instance
* unconditionally allow progmem chars
* missing virtual destructor in Stream
(warning: deleting object of abstract class type 'Stream' which has non-virtual destructor will cause undefined behavior [-Wdelete-non-virtual-dtor])
This commit is contained in:
david gauchard
2022-01-03 13:42:27 +01:00
committed by GitHub
parent e3c79de7c9
commit dde2c769db
3 changed files with 3 additions and 1 deletions

View File

@ -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;
}