core: exit_code work ?

This commit is contained in:
Camille Chauvet
2023-02-24 20:30:01 +01:00
parent fc82eefd7b
commit 370e5149d5
14 changed files with 421 additions and 97 deletions

View File

@ -0,0 +1,27 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_change_exit_code.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/24 19:04:04 by cchauvet #+# #+# */
/* Updated: 2023/02/24 19:05:57 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "../minishell.h"
int ft_change_exit_code(t_data *data, int new_value)
{
char *exit_code_str;
data->exit_code = new_value;
exit_code_str = ft_itoa(new_value);
if (exit_code_str == NULL)
{
ft_eprintf("minishell: malloc failed\n");
return (1);
}
return (0);
}