aboutsummaryrefslogblamecommitdiffstats
path: root/strcasestr.c
blob: 62bcfdb42315c923cdce51f3207bc620f5487892 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                         
/* See LICENSE file for copyright and license details. */
#include "libsimple.h"


char *
libsimple_strcasestr(const char *h_, const char *n)
{
	char *h = *(char **)(void *)&h_;
	size_t hn = strlen(h);
	size_t nn = strlen(n);
	if (hn < nn)
		return NULL;
	for (hn -= nn; hn--; h++)
		if (!strcasecmp(h, n))
			return h;
	return NULL;
}