preotection trim et split

This commit is contained in:
Hugo LAMY
2019-12-09 22:03:22 +01:00
parent 418b9e3af6
commit 9fcfd1ba91
6 changed files with 43 additions and 23 deletions

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 14:01:49 by hulamy #+# #+# */
/* Updated: 2019/12/04 17:06:50 by hulamy ### ########.fr */
/* Updated: 2019/12/09 21:46:54 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -72,7 +72,7 @@
** }
** if (ac == 1)
** {
** s1 = NULL;
** s1 = "fuehf";
** s2 = NULL;
** }
** printf("%s\n",ft_strtrim(s1, s2));
@@ -87,7 +87,7 @@ char *ft_strtrim(char const *s1, char const *set)
int len;
char *str;
if (!s1)
if (!s1 || !set)
return (NULL);
while (s1[0] && ft_strchr(set, s1[0]))
s1++;