diff --git a/Makefile b/Makefile index 220b3a4..952669a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: erey-bet +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 # # # # **************************************************************************** # diff --git a/ft_strtrim.c b/ft_strtrim.c index 5d2cba7..c54b7cc 100644 --- a/ft_strtrim.c +++ b/ft_strtrim.c @@ -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';