We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8d1ec76 + f139519 commit 2ff0fa5Copy full SHA for 2ff0fa5
doc/esp8266wifi/udp-examples.rst
@@ -35,7 +35,7 @@ Once we have libraries in place we need to create a ``WiFiUDP`` object. Then we
35
36
WiFiUDP Udp;
37
unsigned int localUdpPort = 4210;
38
- char incomingPacket[255];
+ char incomingPacket[256];
39
char replyPacket[] = "Hi there! Got the message :-)";
40
41
Wi-Fi Connection
@@ -68,7 +68,7 @@ Waiting for incoming UDP packed is done by the following code:
68
int len = Udp.read(incomingPacket, 255);
69
if (len > 0)
70
{
71
- incomingPacket[len] = 0;
+ incomingPacket[len] = '\0';
72
}
73
Serial.printf("UDP packet contents: %s\n", incomingPacket);
74
0 commit comments