gestion cas n_eat a zero

This commit is contained in:
Hugo LAMY
2022-01-26 18:58:39 +01:00
parent 232684b73a
commit e45ca1331f
4 changed files with 27 additions and 15 deletions

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/26 15:30:19 by hulamy #+# #+# */
/* Updated: 2022/01/26 17:50:31 by hulamy ### ########.fr */
/* Updated: 2022/01/26 18:04:08 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -34,7 +34,7 @@ int ft_isdigit_2d_arr(char **str)
size_t ft_strlen(char *str)
{
size_t i;
size_t i;
i = 0;
while (str[i])
@@ -56,9 +56,9 @@ int ft_strncmp(char *s1, char *s2, size_t n)
return (res);
}
int ft_int_overflow(char *str)
int ft_int_overflow(char *str)
{
size_t len;
size_t len;
char *int_xtrem;
int_xtrem = "2147483647";
@@ -67,11 +67,11 @@ int ft_int_overflow(char *str)
if (str[0] == '+' || str[0] == '-')
str++;
len = ft_strlen(str);
if (len < 10)
return (0);
else if (len > 10 || ft_strncmp(str, int_xtrem, len) > 0)
return (1);
return (0);
if (len < 10)
return (0);
else if (len > 10 || ft_strncmp(str, int_xtrem, len) > 0)
return (1);
return (0);
}
int ft_atoi(const char *str)