Merge branch 'master' of git.chauvet.pro:starnakin/minishell
This commit is contained in:
commit
e0e329a355
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user