Back to index

cell-binutils  2.17cvs20070401
Functions
strstr.c File Reference
#include <stddef.h>

Go to the source code of this file.

Functions

char * strchr (const char *, int)
int strncmp (const void *, const void *, size_t)
size_t strlen (const char *)
char * strstr (const char *s1, const char *s2)

Function Documentation

char* strchr ( const char *  ,
int   
)
size_t strlen ( const char *  )
int strncmp ( const void *  ,
const void *  ,
size_t   
)
char* strstr ( const char *  s1,
const char *  s2 
)

Definition at line 30 of file strstr.c.

{
  const char *p = s1;
  const size_t len = strlen (s2);

  for (; (p = strchr (p, *s2)) != 0; p++)
    {
      if (strncmp (p, s2, len) == 0)
       return (char *)p;
    }
  return (0);
}

Here is the call graph for this function: