diff --git a/utils/ft_atoi_check.c b/utils/ft_atoi_check.c index ba7d097..1a9e360 100644 --- a/utils/ft_atoi_check.c +++ b/utils/ft_atoi_check.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/07/21 08:21:05 by erey-bet #+# #+# */ -/* Updated: 2022/12/08 16:37:19 by erey-bet ### ########.fr */ +/* Updated: 2023/02/28 13:52:13 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,12 +39,12 @@ int ft_atoi_check(const char *nptr) { result = result * 10 + *nptr++ - '0'; if ((result > 2147483647 && sign == 1) - || (result > 2147483648 && sign == -1)) - return (0); + || (result > 2147483647 && sign == 1)) + return (2); } if (*nptr--) - return (0); + return (1); if (*nptr == '-' || *nptr == '+') - return (0); - return (1); + return (1); + return (0); }