preotection trim et split
This commit is contained in:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user