text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_memchr.c                                        :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: dhromads <marvin@42.fr>                    +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2018/04/16 16:42:39 by dhromads          #+#    #+#             */
  /*   Updated: 2018/04/16 16:42:40 by dhromads         ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  
  void	*ft_memchr(const void *s, int c, size_t n)
  {
  	unsigned char	*ptr;
  	unsigned char	c2;
  	int				i;
  
  	i = 0;
  	c2 = (unsigned char)c;
  	ptr = (unsigned char *)s;
  	while (n--)
  	{
  		if (ptr[i] == c2)
  			return (ptr + i);
  		i++;
  	}
  	return (NULL);
  }
  