ESGIbdurifjjkigjikdthijir

This commit is contained in:
Etienne Rey-bethbeder 2023-02-28 14:36:07 +01:00
parent d5eb265a3f
commit 6e0d7288e8

View File

@ -6,7 +6,7 @@
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */ /* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/21 08:21:05 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'; result = result * 10 + *nptr++ - '0';
if ((result > 2147483647 && sign == 1) if ((result > 2147483647 && sign == 1)
|| (result > 2147483648 && sign == -1)) || (result > 2147483647 && sign == 1))
return (0); return (2);
} }
if (*nptr--) if (*nptr--)
return (0);
if (*nptr == '-' || *nptr == '+')
return (0);
return (1); return (1);
if (*nptr == '-' || *nptr == '+')
return (1);
return (0);
} }