text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_strnew.c                                        :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: rtorres- <rtorres-@student.42.us.org>      +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2016/11/03 15:18:33 by rtorres-          #+#    #+#             */
  /*   Updated: 2016/11/03 15:18:34 by rtorres-         ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  
  /*
  ** Allocates with malloc() and returns a “fresh” string ending with ’\0’.
  ** Each character of the string is initialized at ’\0’.
  ** If the allocation fails the function returns NULL.
  */
  
  char	*ft_strnew(size_t size)
  {
  	char	*str;
  
  	if (!(str = (char *)malloc(sizeof(char) * size + 1)))
  		return (NULL);
  	str[size] = '\0';
  	while (size--)
  		str[size] = '\0';
  	return (str);
  }
  