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:40 by hulamy #+# #+# */
/* Updated: 2019/12/04 17:01:25 by hulamy ### ########.fr */
/* Updated: 2019/12/09 21:44:07 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -47,8 +47,8 @@
** str = strdup(av[1]);
** if (ac == 1)
** str = NULL;
** printf("%s\n",str);
** str = ft_strmapi(str, touppercase);
** //str = ft_strmapi(str, touppercase);
** str = ft_strmapi(str, NULL);
** printf("%s\n",str);
** return (0);
** }
@@ -62,7 +62,7 @@ char *ft_strmapi(char const *s, char (*f)(unsigned int, char))
int i;
int size;
if (!s)
if (!s || !f)
return (NULL);
size = ft_strlen(s);
if (!(str = (char *)malloc(sizeof(char) * (size + 1))))