text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_strsub.c                                        :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: mghazari <mghazari@student.42.fr>          +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2016/12/27 05:51:39 by mghazari          #+#    #+#             */
  /*   Updated: 2016/12/27 05:51:40 by mghazari         ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  
  char	*ft_strsub(char const *s, unsigned int start, size_t len)
  {
  	char	*str;
  	size_t	i;
  
  	i = 0;
  	str = malloc(len + 1);
  	if (!s || !str)
  		return (NULL);
  	while (i < len)
  	{
  		str[i] = s[start];
  		i++;
  		start++;
  	}
  	str[i] = '\0';
  	return (str);
  }
  