1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-27 21:16:50 +03:00

Exclude the terminator in sendContent_P

The terminator should not be sent by sendContent_P. For example, if you
have a null-terminated string, the null itself should not be sent to the
client. This change decrements the number of bytes to send so it does
not include the termination character.
This commit is contained in:
JohnSL 2015-11-08 19:28:55 -08:00
parent 810ab68ae5
commit c0f8ce9d84

View File

@ -226,8 +226,8 @@ void ESP8266WebServer::sendContent_P(PGM_P content) {
contentUnitLen = HTTP_DOWNLOAD_UNIT_SIZE;
}
else {
// reached terminator
contentUnitLen = contentNext - contentUnit;
// reached terminator. Do not send the terminator
contentUnitLen = contentNext - contentUnit - 1;
content = NULL;
}