text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_atoi.c                                          :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: rsilva <rsilva@student.42.us.org>          +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2018/02/26 16:43:27 by rsilva            #+#    #+#             */
  /*   Updated: 2018/02/26 16:43:34 by rsilva           ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  int	ft_atoi(const char *str)
  {
  	int nbr;
  	int neg;
  	int i;
  
  	nbr = 0;
  	neg = 1;
  	i = 0;
  	while ((str[i] >= 9 && str[i] <= 13) || str[i] == 32)
  		i++;
  	if (str[i] == '-')
  	{
  		neg = -1;
  		i++;
  	}
  	else if (str[i] == '+')
  		i++;
  	while (str[i] >= '0' && str[i] <= '9')
  	{
  		nbr = (nbr * 10) + (str[i] - '0');
  		i++;
  	}
  	return (nbr * neg);
  }
  