mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 08:41:58 +00:00
fixing the parsing
This commit is contained in:
@@ -11,6 +11,17 @@
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "check_error.h"
|
||||
#include "parsing.h"
|
||||
|
||||
int verif_is_number(char **tab)
|
||||
{
|
||||
int len;
|
||||
|
||||
len = len_split(tab);
|
||||
if (tab[len - 1][0] == '-')
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
int check_error(char **tab, int mod)
|
||||
{
|
||||
@@ -22,5 +33,7 @@ int check_error(char **tab, int mod)
|
||||
return (0);
|
||||
if (!verif_double(tab, mod))
|
||||
return (0);
|
||||
if (!verif_is_number(tab))
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user