text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_memccpy.c                                       :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: ttranche <ttranche@student.42.fr>          +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2020/11/16 12:18:34 by ttranche          #+#    #+#             */
  /*   Updated: 2020/11/16 22:33:19 by ttranche         ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  
  void	*ft_memccpy(void *dst, const void *src, int c, size_t n)
  {
  	unsigned char	*d;
  	unsigned char	*s;
  	size_t			i;
  
  	d = (unsigned char *)dst;
  	s = (unsigned char *)src;
  	i = 0;
  	while (i < n)
  	{
  		d[i] = s[i];
  		if (s[i++] == (unsigned char)c)
  			return (dst + i);
  	}
  	return (NULL);
  }
  