aboutsummaryrefslogtreecommitdiff
path: root/src/str/ft_strsdestroy.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-05-11 16:14:38 +0200
committerCharles <sircharlesaze@gmail.com>2020-05-11 16:14:38 +0200
commitb9f000a80cbba38b8f21c9737a42f07573ec7b91 (patch)
tree7068e7188dab0a710ae79d71800b329ab655e3eb /src/str/ft_strsdestroy.c
parenta4b9cda7d6733f2b077f8586e3b3e69351e7dfba (diff)
downloadlibft-b9f000a80cbba38b8f21c9737a42f07573ec7b91.tar.gz
libft-b9f000a80cbba38b8f21c9737a42f07573ec7b91.tar.bz2
libft-b9f000a80cbba38b8f21c9737a42f07573ec7b91.zip
Moved util/ft_split* in str, Added ft_memjoin and ft_memjoinf1, Modified ft_getfile so that it can read non-ascii file
Diffstat (limited to 'src/str/ft_strsdestroy.c')
-rw-r--r--src/str/ft_strsdestroy.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/str/ft_strsdestroy.c b/src/str/ft_strsdestroy.c
new file mode 100644
index 0000000..bb2204c
--- /dev/null
+++ b/src/str/ft_strsdestroy.c
@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_strsdestroy.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/27 16:30:55 by cacharle #+# #+# */
+/* Updated: 2020/05/11 15:53:49 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_str.h"
+
+/*
+** \brief Destroy a NULL-terminated array of malloc'd string
+** \param strs Strings to destroy
+** \return NULL (so that it can be used in return statement)
+*/
+
+void *ft_strsdestroy(char **strs)
+{
+ int i;
+
+ i = -1;
+ while (strs[++i] != NULL)
+ free(strs[i]);
+ free(strs);
+ return (NULL);
+}