ft_free_null()

+ refactoring shell_loop()
This commit is contained in:
LuckyLaszlo
2021-11-30 14:12:05 +01:00
parent b265e8475a
commit ffd06c4b95
5 changed files with 37 additions and 23 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/08 09:25:35 by lperrey #+# #+# */
/* Updated: 2021/11/27 12:58:20 by lperrey ### ########.fr */
/* Updated: 2021/11/30 13:11:48 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -211,3 +211,9 @@ int ft_reti_perror_io(int ret, char *err_str, char *io_file)
perror(io_file);
return (ret);
}
void ft_free_null(void *ptr)
{
free(*(char**)ptr);
*(char**)ptr = NULL;
}