text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_strlcpy.c                                       :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: hsabir <marvin@42lausanne.ch>              +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2021/10/13 16:31:53 by hsabir            #+#    #+#             */
  /*   Updated: 2021/10/13 17:48:37 by hsabir           ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  
  size_t	ft_strlcpy(char *dst, const char *src, size_t dstsize)
  {
  	size_t	i;
  	size_t	srcsize;
  
  	i = 0;
  	if (src != NULL)
  		srcsize = ft_strlen(src);
  	else if (dst != NULL)
  		srcsize = ft_strlen(dst);
  	while (!(dst == NULL || src == NULL)
  		&& dstsize != 0 && src[i] && i < dstsize - 1)
  	{
  		dst[i] = src[i];
  		i++;
  	}
  	if (dstsize > 0)
  		dst[i] = '\0';
  	return (srcsize);
  }
  