text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_strdup.c                                        :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: jdhaisne <marvin@42.fr>                    +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2015/11/25 11:26:09 by jdhaisne          #+#    #+#             */
  /*   Updated: 2015/12/02 17:52:52 by jdhaisne         ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  #include <stdlib.h>
  
  char	*ft_strdup(const char *s)
  {
  	size_t	s1size;
  	int		i;
  	char	*s2;
  
  	i = 0;
  	s2 = NULL;
  	s1size = ft_strlen(s);
  	s2 = (char*)malloc((sizeof(char) * s1size) + 1);
  	if (s2 == NULL)
  		return (NULL);
  	while (s[i] != '\0')
  	{
  		s2[i] = s[i];
  		i++;
  	}
  	s2[i] = '\0';
  	return (s2);
  }
  