Commit dcc3d192 authored by abenoit's avatar abenoit
Browse files

fix exit argument validation

parent 38b4bdca
......@@ -6,7 +6,7 @@
/* By: mvidal-a <mvidal-a@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/02 15:55:50 by mvidal-a #+# #+# */
/* Updated: 2021/02/02 16:14:16 by mvidal-a ### ########.fr */
/* Updated: 2021/02/04 17:23:43 by abenoit ### ########.fr */
/* */
/* ************************************************************************** */
......@@ -16,6 +16,10 @@ int ft_isnumber(char *str)
{
while (ft_isspace(*str))
str++;
if (ft_isdigit(*str) || *str == '-')
str++;
else
return (FALSE);
while (!ft_isspace(*str) && *str != '\0')
{
if (!ft_isdigit(*str))
......
......@@ -15,7 +15,7 @@ int ft_exit(char **args, t_xe *xe)
return (WRITE_ERR);
return (EXIT_ARG_ERR);
}
xe->stat_loc = ft_atoi(args[1]) % 256;
xe->stat_loc = (unsigned int)ft_atoi(args[1]) % 256;
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment