-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strstr.c
executable file
·36 lines (33 loc) · 1.17 KB
/
ft_strstr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ioleksiu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/08 20:58:55 by ioleksiu #+# #+# */
/* Updated: 2016/12/15 17:00:50 by ioleksiu ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
char *ft_strstr(const char *big, const char *little)
{
const char *l;
const char *b;
if (!*little)
return ((char *)big);
while (*big)
{
l = little;
b = big;
while (*l && *b && *l == *b)
{
b++;
l++;
}
if (!*l)
return ((char*)big);
big++;
}
return (0);
}