1#include <stddef.h>2#include <string.h>34#undef strstr56char *7strstr(const char *s1, const char *s2)8{9 const char *p;10 int c = *s2;11 size_t len;1213 if ((len = strlen(s2)) == 0)14 return (char *) s1;1516 for (p = s1; p = strchr(p, c); ++p) {17 if (!strncmp(p, s2, len))18 return (char *) p;19 }2021 return NULL;22}