You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe there's a misunderstanding here and not a bug.
sendContent_P(char *data, int len) is transmitting the exact same amount of data as sendContent(char *data, int len), namely len bytes.
Your code makes len == sizeof("string"). But, sizeof(<any string>) includes the terminal NUL. That is, sizeof("<str>") != strlen("<str>"). sizeof("<str>") == 6, strlen("<str>") == 5.
Instead, for ASCII data like this, just use sendContent_P(PSTR), which uses strlen_P to get the exact string len, not including the trailing 0.
WebServer sends \0 at end of content when using send_P
SDK:3.0.0-dev(c0f7b44)/Core:2.5.0=20500000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1/BearSSL:6778687
Similar to #987
The following MCVE sketch serves an image using the SoftAP and adds the \0 causing the image to be corrupt.
The text was updated successfully, but these errors were encountered: