strstr.c
Upload User: wstnjxml
Upload Date: 2014-04-03
Package Size: 7248k
Code Size: 0k
Category:

Windows CE

Development Platform:

C/C++

  1. #ifdef HAVE_CONFIG_H
  2. #include "config.h"
  3. #endif
  4. #include <string.h>
  5. char *strstr(const char *haystack, const char *needle)
  6. {
  7. const char *scan;
  8. size_t len;
  9. char firstc;
  10. firstc = *needle;
  11. len = strlen(needle);
  12. for (scan = haystack; *scan != firstc || strncmp(scan, needle, len); )
  13. if (!*scan++)
  14. return NULL;
  15. return (char *)scan;
  16. }