Skip to content

Commit b513859

Browse files
committed
Remove unneeded memchr implementation
Include the correct header to ensure it is defined.
1 parent 3c19f99 commit b513859

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/WebResponses.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
License along with this library; if not, write to the Free Software
1919
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
*/
21+
22+
#include <string.h>
2123
#include "ESPAsyncWebServer.h"
2224
#include "WebResponseImpl.h"
2325
#include "cbuf.h"
@@ -36,16 +38,6 @@
3638
// When looking up available memory, leave some slack
3739
#define BLOCK_SIZE_SLACK 128
3840

39-
// Since ESP8266 does not link memchr by default, here's its implementation.
40-
void* memchr(void* ptr, int ch, size_t count)
41-
{
42-
unsigned char* p = static_cast<unsigned char*>(ptr);
43-
while(count--)
44-
if(*p++ == static_cast<unsigned char>(ch))
45-
return --p;
46-
return nullptr;
47-
}
48-
4941

5042
/*
5143
* Abstract Response

0 commit comments

Comments
 (0)