2 files changed, +24, -4
7bb9afcchanges strtrim and adds split prototype
ft_strsplit.c
+20, -0
ft_strtrim.c
+4, -4
+20, -0
@@ -0,0 +1,20 @@
1+/* ************************************************************************** */
2+/* */
3+/* ::: :::::::: */
4+/* ft_strsplit.c :+: :+: :+: */
5+/* +:+ +:+ +:+ */
6+/* By: mleitao <mleitao@student.42.fr> +#+ +:+ +#+ */
7+/* +#+#+#+#+#+ +#+ */
8+/* Created: 2026/03/13 18:34:00 by mleitao #+# #+# */
9+/* Updated: 2026/03/13 18:37:47 by mleitao ### ########.fr */
10+/* */
11+/* ************************************************************************** */
12+
13+#include "libft.h"
14+
15+static int count
16+
17+ char **
18+ ft_split(char const *s, char c)
19+{
20+}
+4, -4
@@ -6,13 +6,13 @@
6 6 /* By: mleitao <mleitao@student.42.fr> +#+ +:+ +#+ */
7 7 /* +#+#+#+#+#+ +#+ */
8 8 /* Created: 2026/03/13 18:02:43 by mleitao #+# #+# */
9 -/* Updated: 2026/03/13 18:28:41 by mleitao ### ########.fr */
9+/* Updated: 2026/03/13 18:38:45 by mleitao ### ########.fr */
1010 /* */
1111 /* ************************************************************************** */
1212
1313 #include "libft.h"
1414
15 -static int ft_in_set(char c, char const *set)
15+static int in_set(char c, char const *set)
1616 {
1717 while (*set)
1818 {
@@ -32,10 +32,10 @@ char *ft_strtrim(char const *s1, char const *set)
3232 if (!s1 || !set)
3333 return (NULL);
3434 s = s1;
35 - while (*s && ft_in_set(*s, set))
35+ while (*s && in_set(*s, set))
3636 s++;
3737 e = s1 + ft_strlen(s1);
38 - while (e > s && ft_in_set(*(e - 1), set))
38+ while (e > s && in_set(*(e - 1), set))
3939 e--;
4040 r = malloc(e - s + 1);
4141 if (!r)