Skip to content

Commit fcd214b

Browse files
committed
string reservation
1 parent a71e1c9 commit fcd214b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor_v2/mDNS_ServiceMonitor_v2.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ void handleHTTPRequest() {
204204

205205
IPAddress ip = server.client().localIP();
206206
String ipStr = ip.toString();
207-
String s = "<!DOCTYPE HTML>\r\n<html><h3><head>Hello from ";
207+
String s;
208+
s.reserve(200 /* + service listed */);
209+
s = "<!DOCTYPE HTML>\r\n<html><h3><head>Hello from ";
208210
s += WiFi.hostname() + ".local at " + server.client().localIP().toString() + "</h3></head>";
209211
s += "<br/><h4>Local HTTP services are :</h4>";
210212
s += "<ol>";

0 commit comments

Comments
 (0)