Lab2_web / Mbed 2 deprecated webserverBlinky

Dependencies:   mbed

Fork of webserverBlinky by RealTimeCompLab2

Revision:
168:c77eb908042a
Parent:
167:ff8a2d8beeb1
Child:
169:ee90aed3a735
diff -r ff8a2d8beeb1 -r c77eb908042a PPP-Blinky/ppp-blinky.cpp
--- a/PPP-Blinky/ppp-blinky.cpp	Mon Sep 04 04:13:15 2017 +0000
+++ b/PPP-Blinky/ppp-blinky.cpp	Mon Sep 04 04:27:33 2017 +0000
@@ -598,9 +598,8 @@
         swapIpPorts(); // swap IP source and destination ports
         if (echoFound) {
             memcpy(ppp.udp->data,"Got{",4); // in the UDP data modify "echo" to "Got:"
-            char endString[] = "} UDP Server: PPP-Blinky\n"; // an appendix
-            memcpy(ppp.udp->data+udpLength.data,endString,sizeof(endString)-1); // add endstring size to the UDP message
-            udpLength.all = udpLength.data + sizeof(endString)-1; // update udp data size with the size of the appendix
+            int n = sprintf(ppp.udp->data+udpLength.data, "} UDP Server: PPP-Blinky\n"); // an appendix
+            udpLength.data = udpLength.data + n; // update udp data size with the size of the appendix
         }
         if (testFound) {
             char udpResponse[50];