aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libft_lst.h2
-rw-r--r--include/libft_util.h20
-rw-r--r--src/ht/ft_htnew.c2
-rw-r--r--src/lst/ft_lstlfind.c4
-rw-r--r--src/lst/ft_lstlsearch.c4
-rw-r--r--src/util/ft_split_destroy.c24
6 files changed, 50 insertions, 6 deletions
diff --git a/include/libft_lst.h b/include/libft_lst.h
index 2b4321c..5669979 100644
--- a/include/libft_lst.h
+++ b/include/libft_lst.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/31 10:36:39 by cacharle #+# #+# */
-/* Updated: 2020/02/28 12:09:21 by cacharle ### ########.fr */
+/* Updated: 2020/02/28 12:23:31 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/include/libft_util.h b/include/libft_util.h
new file mode 100644
index 0000000..7a9e056
--- /dev/null
+++ b/include/libft_util.h
@@ -0,0 +1,20 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* libft_util.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/27 17:51:36 by cacharle #+# #+# */
+/* Updated: 2020/02/27 17:52:16 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef LIBFT_UTIL_H
+# define LIBFT_UTIL_H
+
+# include <stdlib.h>
+
+void *ft_split_destroy(char **strs);
+
+#endif
diff --git a/src/ht/ft_htnew.c b/src/ht/ft_htnew.c
index f77398f..6827c36 100644
--- a/src/ht/ft_htnew.c
+++ b/src/ht/ft_htnew.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/30 08:19:16 by cacharle #+# #+# */
-/* Updated: 2020/02/28 12:10:51 by cacharle ### ########.fr */
+/* Updated: 2020/02/28 12:23:43 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/lst/ft_lstlfind.c b/src/lst/ft_lstlfind.c
index 92d37d8..c399b6e 100644
--- a/src/lst/ft_lstlfind.c
+++ b/src/lst/ft_lstlfind.c
@@ -5,8 +5,8 @@
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/17 03:04:52 by cacharle #+# #+# */
-/* Updated: 2020/02/19 02:03:11 by cacharle ### ########.fr */
+/* Created: 2020/02/27 18:00:37 by cacharle #+# #+# */
+/* Updated: 2020/02/28 12:24:05 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/lst/ft_lstlsearch.c b/src/lst/ft_lstlsearch.c
index 8d2acc8..f59b5de 100644
--- a/src/lst/ft_lstlsearch.c
+++ b/src/lst/ft_lstlsearch.c
@@ -5,8 +5,8 @@
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/17 02:57:12 by cacharle #+# #+# */
-/* Updated: 2020/02/17 03:35:45 by cacharle ### ########.fr */
+/* Created: 2020/02/27 16:18:33 by cacharle #+# #+# */
+/* Updated: 2020/02/28 12:24:31 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/util/ft_split_destroy.c b/src/util/ft_split_destroy.c
new file mode 100644
index 0000000..bc3f4e6
--- /dev/null
+++ b/src/util/ft_split_destroy.c
@@ -0,0 +1,24 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_split_destroy.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/27 16:30:55 by cacharle #+# #+# */
+/* Updated: 2020/02/27 17:52:31 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_util.h"
+
+void *ft_split_destroy(char **strs)
+{
+ int i;
+
+ i = -1;
+ while (strs[++i] != NULL)
+ free(strs[i]);
+ free(strs);
+ return (NULL);
+}