Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ESP8266_WebServer mbed
Fork of WiFiLamp by
Diff: ESP8266_WebServer/ESP8266_WebServer.cpp
- Revision:
- 14:416fff90cd0f
- Parent:
- 11:3ab606a42227
- Child:
- 15:ad68100221b8
--- a/ESP8266_WebServer/ESP8266_WebServer.cpp	Sun Dec 28 16:09:20 2014 +0000
+++ b/ESP8266_WebServer/ESP8266_WebServer.cpp	Mon Dec 29 11:44:00 2014 +0000
@@ -157,7 +157,9 @@
 }
 
 void ESP8266_WebServer::SendReply(int linkID, const char* reply, int replySize, const char* mimeType) {
-    sprintf(response, "HTTP/1.1 200 OK\r\nContent-Type:%s\r\nContent-Length: %d\r\n\r\n%s", mimeType, replySize, reply);
+    sprintf(response, "HTTP/1.1 200 OK\r\nContent-Type:%s\r\nContent-Length: %d\r\n\r\n", mimeType, replySize);
+    sendResponse(linkID, strlen(response));
+    strncpy(response, reply, replySize);
     sendResponse(linkID, strlen(response));
 }
 
    