Fixed RGB parsing

This commit is contained in:
Philippe BLAGOJEVIC
2022-05-04 16:53:38 +02:00
parent a6c61ec557
commit 6000629c17
5 changed files with 12 additions and 26 deletions

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 13:54:29 by hulamy #+# #+# */
/* Updated: 2022/05/04 14:09:01 by pblagoje ### ########.fr */
/* Updated: 2022/05/04 16:44:26 by pblagoje ### ########.fr */
/* */
/* ************************************************************************** */
@@ -29,5 +29,9 @@ int ft_atoi(const char *str)
i++;
while (str[i] >= '0' && str[i] <= '9')
nbr = nbr * 10 + (str[i++] - '0');
while ((str[i] == ' ') || (str[i] > 8 && str[i] < 14))
i++;
if (str[i] != '\0')
return (-1);
return (nbr * negatif);
}