Merge branch 'master' of git.chauvet.pro:starnakin/minishell

This commit is contained in:
Camille Chauvet 2023-03-13 12:45:42 +01:00
commit e2c43eb973

View File

@ -6,7 +6,7 @@
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */ /* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/24 10:17:59 by erey-bet #+# #+# */ /* Created: 2023/02/24 10:17:59 by erey-bet #+# #+# */
/* Updated: 2023/03/09 20:08:56 by erey-bet ### ########.fr */ /* Updated: 2023/03/10 14:52:22 by erey-bet ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -29,7 +29,10 @@ int ft_exit(char **args)
int err; int err;
if (args[0] == NULL) if (args[0] == NULL)
{
write(1, "exit\n", 6);
return (0); return (0);
}
err = ft_atoi_check(args[0]); err = ft_atoi_check(args[0]);
if (err == 1) if (err == 1)
return (error(err, "numeric argument required", args[0])); return (error(err, "numeric argument required", args[0]));
@ -37,5 +40,6 @@ int ft_exit(char **args)
return (error(1, "too many arguments", NULL)); return (error(1, "too many arguments", NULL));
if (err > 0) if (err > 0)
return (error(err, "numeric argument required", args[0])); return (error(err, "numeric argument required", args[0]));
write(1, "exit\n", 6);
return ((ft_atoi(args[0]) % 256 + 256) % 256); return ((ft_atoi(args[0]) % 256 + 256) % 256);
} }