aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/ft_split_destroy.c24
1 files changed, 24 insertions, 0 deletions
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);
+}