From 50876fe6b9e369d6b51bac9fa62b790ef5bda9d7 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 9 Sep 2020 15:51:20 +0200 Subject: Added ft_htset_safe --- src/ht/ft_htset_safe.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/ht/ft_htset_safe.c (limited to 'src') diff --git a/src/ht/ft_htset_safe.c b/src/ht/ft_htset_safe.c new file mode 100644 index 0000000..fd132d2 --- /dev/null +++ b/src/ht/ft_htset_safe.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_htset_safe.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/09/09 15:46:10 by charles #+# #+# */ +/* Updated: 2020/09/09 15:46:24 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft_ht.h" + +t_ftht_entry *ft_htset_safe( + t_ftht *ht, + char *key, + void *value, + void (*del)(void*) +) +{ + if (value == NULL) + return (NULL); + return (ft_htset(ht, key, value, del)); +} -- cgit