-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strnstr.c
executable file
·23 lines (20 loc) · 1.07 KB
/
ft_strnstr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ioleksiu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/09 19:51:14 by ioleksiu #+# #+# */
/* Updated: 2016/12/15 16:58:11 by ioleksiu ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strnstr(const char *big, const char *little, size_t len)
{
char *b;
b = ft_strstr(big, little);
if ((b - big) + ft_strlen(little) > len)
return (0);
return (b);
}