text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_memccpy.c                                       :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: tidadi <marvin@42.fr>                      +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2018/11/08 20:24:48 by tidadi            #+#    #+#             */
  /*   Updated: 2018/11/10 19:13:32 by tidadi           ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  
  void	*ft_memccpy(void *dst, const void *src, int c, size_t n)
  {
  	char	*ptr;
  	size_t	i;
  
  	i = -1;
  	ptr = dst;
  	while (++i < n)
  	{
  		*(ptr + i) = *((unsigned char *)src + i);
  		if (*((unsigned char *)src + i) == (unsigned char)c)
  			return (dst + i + 1);
  	}
  	return (NULL);
  }
  