ft_nm/subprojects/libft/ft_strstr.c

30 lines
1.1 KiB
C
Raw Normal View History

2019-05-10 18:29:21 +03:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/30 19:32:43 by gtertysh #+# #+# */
/* Updated: 2016/12/06 14:23:54 by gtertysh ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strstr(const char *big, const char *little)
{
size_t l;
l = ft_strlen(little);
if (!*little)
return ((char *)big);
while (*big)
{
if (!(ft_memcmp(big, little, l)))
return ((char *)big);
big++;
}
return (NULL);
}