/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_memcpy.c                                        :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: pbonilla <eirodeis.lepnj@gmail.com>        +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/10/27 18:52:38 by pbonilla          #+#    #+#             */
/*   Updated: 2021/01/29 12:11:19 by pbonilla         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "libft.h"

void	*ft_memcpy(void *dest, const void *src, size_t n)
{
	unsigned char	*buff;
	unsigned char	*buff2;
	unsigned int	i;

	buff = (unsigned char *)dest;
	buff2 = (unsigned char *)src;
	if (!buff && !buff2)
		return (NULL);
	i = -1;
	while (++i != n)
		buff[i] = buff2[i];
	return (buff);
}