text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_strdup.c                                        :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: albarbos <marvin@42.fr>                    +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2017/11/07 11:05:52 by albarbos          #+#    #+#             */
  /*   Updated: 2017/11/07 11:05:53 by albarbos         ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include <stdlib.h>
  
  int		ft_strlen(char *str)
  {
  	int i;
  
  	i = 0;
  	while (str[i])
  	{
  		i++;
  	}
  	return (i);
  }
  
  char	*ft_strdup(char *src)
  {
  	char	*temp;
  	int		i;
  
  	i = 0;
  	if (!(temp = malloc(sizeof(char) * (ft_strlen(src) + 1))))
  		return (0);
  	while (src[i])
  	{
  		temp[i] = src[i];
  		i++;
  	}
  	temp[i] = '\0';
  	return (temp);
  }
  