text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_strstr.c                                        :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: cpieri <marvin@42.fr>                      +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2017/11/10 12:54:41 by cpieri            #+#    #+#             */
  /*   Updated: 2017/11/16 14:53:45 by cpieri           ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  
  char	*ft_strstr(const char *haystack, const char *needle)
  {
  	int		i;
  	int		j;
  
  	i = 0;
  	if (needle[0] == '\0')
  		return ((char*)haystack);
  	while (haystack[i])
  	{
  		if (haystack[i] == needle[0])
  		{
  			j = 0;
  			while (needle[j] == haystack[i + j])
  			{
  				j++;
  				if (needle[j] == '\0')
  					return ((char*)haystack + i);
  			}
  		}
  		i++;
  	}
  	return (NULL);
  }
  