1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-16 11:21:18 +03:00

Netdump printf fix (#8215)

* Fix crash printf long getTime()

* Update several printf to printf_P
This commit is contained in:
hreintke
2021-07-17 20:50:15 +02:00
committed by GitHub
parent 25a21c3e7d
commit 09c4e33106
3 changed files with 8 additions and 8 deletions

View File

@ -42,21 +42,21 @@ void Packet::printDetail(Print& out, const String& indent, const char* data, siz
{
end = size;
}
out.printf("%s", indent.c_str());
out.printf_P(PSTR("%s"), indent.c_str());
if (pd != PacketDetail::CHAR)
{
for (size_t i = start; i < end; i++)
{
out.printf("%02x ", (unsigned char)data[i]);
out.printf_P(PSTR("%02x "), (unsigned char)data[i]);
}
for (size_t i = end; i < start + charCount; i++)
{
out.print(" ");
out.printf_P(PSTR(" "));
}
}
for (size_t i = start; i < end; i++)
{
out.printf("%c", data[i] >= 32 && data[i] < 128 ? data[i] : '.');
out.printf_P(PSTR("%c"), data[i] >= 32 && data[i] < 128 ? data[i] : '.');
}
out.println();
@ -253,7 +253,7 @@ void Packet::ICMPtoString(PacketDetail, StreamString& sstr) const
default: sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType()); break;
}
}
sstr.printf("\r\n");
sstr.printf_P(PSTR("\r\n"));
}
void Packet::IGMPtoString(PacketDetail, StreamString& sstr) const