-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_set_free_and_null.c
24 lines (22 loc) · 1.08 KB
/
ft_set_free_and_null.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_set_free_and_null.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mavinici <mavinici@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/05 00:29:41 by mavinici #+# #+# */
/* Updated: 2022/04/21 09:31:22 by mavinici ### ########.fr */
/* */
/* ************************************************************************** */
#include <libft.h>
// Set free and null in a char *
// It's necessary pass a char **
// example &str if is a char *
char *ft_set_free_and_null(char **str)
{
if (*str)
free(*str);
*str = NULL;
return (NULL);
}