Logo Search packages:      
Sourcecode: wireshark version File versions  Download package

char* epan_strcasestr ( const char *  haystack,
const char *  needle 
)

Finds the first occurence of string 'needle' in string 'haystack'. The matching is done in a case insensitive manner.

Parameters:
haystack The string possibly containing the substring
needle The substring to be searched
Returns:
A pointer into 'haystack' where 'needle' is first found. Otherwise it returns NULL.

Definition at line 942 of file strutil.c.

{
      gsize hlen = strlen(haystack);
      gsize nlen = strlen(needle);

      while (hlen-- >= nlen) {
            if (!g_ascii_strncasecmp(haystack, needle, nlen))
                  return (char*) haystack;
            haystack++;
      }
      return NULL;
}


Generated by  Doxygen 1.6.0   Back to index