fix: support only > 0 number
This commit is contained in:
parent
008b30e12c
commit
7e5d4af478
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/04/27 11:34:57 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/04/27 11:34:58 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/05/17 13:43:29 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -23,13 +23,15 @@ static bool check_amount_of_argument(size_t n)
|
||||
|
||||
static bool check_value(char **av, size_t n)
|
||||
{
|
||||
size_t i;
|
||||
size_t i;
|
||||
|
||||
i = 0;
|
||||
while (i < n)
|
||||
{
|
||||
if (ft_isnum(av[i]) == 0)
|
||||
return (1);
|
||||
if (!(ft_atoi(av[i]) > 0))
|
||||
return (1);
|
||||
i++;
|
||||
}
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user