der des der des der

This commit is contained in:
Etienne Rey-bethbeder 2022-10-19 17:46:58 +02:00
parent 6ee4c3dd87
commit 9a3da40a5c
2 changed files with 11 additions and 4 deletions

View file

@ -6,7 +6,7 @@
# By: erey-bet <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/27 04:19:30 by erey-bet #+# #+# #
# Updated: 2022/10/15 15:06:59 by erey-bet ### ########.fr #
# Updated: 2022/10/19 17:45:46 by erey-bet ### ########.fr #
# #
# **************************************************************************** #

View file

@ -24,8 +24,11 @@ static int get_start(const char *str, char const *set)
y = 0;
check = 0;
while (set[y])
if (str[i] == set[y++])
{
if (str[i] == set[y])
check = 1;
y++;
}
if (check == 0)
return (i);
i++;
@ -45,8 +48,11 @@ static int get_end(const char *str, char const *set)
y = 0;
check = 0;
while (set[y])
if (str[i] == set[y++])
{
if (str[i] == set[y])
check = 1;
y++;
}
if (check == 0)
return (i + 1);
i--;
@ -71,7 +77,8 @@ char *ft_strtrim(char const *s1, char const *set)
i = 0;
while (start < end)
{
str[i++] = s1[start];
str[i] = s1[start];
i++;
start++;
}
str[i] = '\0';