text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_strlcpy.c                                       :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: atrouill <marvin@42.fr>                    +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2019/08/02 23:13:24 by atrouill          #+#    #+#             */
  /*   Updated: 2019/08/03 10:12:01 by atrouill         ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  unsigned int	ft_strlen(char *str)
  {
  	unsigned int i;
  
  	i = 0;
  	while (str[i] != '\0')
  	{
  		i++;
  	}
  	return (i);
  }
  
  unsigned int	ft_strlcpy(char *dest, char *src, unsigned int size)
  {
  	unsigned int srclen;
  	unsigned int i;
  
  	srclen = ft_strlen(src);
  	i = 0;
  	if (srclen + 1 < size)
  	{
  		while (i < srclen + 1)
  		{
  			dest[i] = src[i];
  			i++;
  		}
  	}
  	else if (size != 0)
  	{
  		while (i < size - 1)
  		{
  			dest[i] = src[i];
  			i++;
  		}
  		dest[size - 1] = '\0';
  	}
  	return (srclen);
  }
  