42_minishell/data/data.c
2023-03-10 13:40:20 +01:00

19 lines
298 B
C

#include "./data_private.h"
int ft_gen_exit_code(t_data *data)
{
char *str;
if (data->exit_code_str != NULL)
free(data->exit_code_str);
str = ft_itoa(data->exit_code);
if (str == NULL)
{
ft_printf("minishell: malloc failed");
return (1);
}
data->exit_code_str = str;
return (0);
}