From b5148838f8077da5717c21617874ad2f617a6f1e Mon Sep 17 00:00:00 2001 From: umeneses Date: Fri, 28 Jun 2024 12:31:53 -0300 Subject: [PATCH] fixing is_not_duplicated, if the future_pos is NULL --- program_to_test/src/ft_argv_validation.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/program_to_test/src/ft_argv_validation.c b/program_to_test/src/ft_argv_validation.c index dd78b18..e36ae47 100644 --- a/program_to_test/src/ft_argv_validation.c +++ b/program_to_test/src/ft_argv_validation.c @@ -6,7 +6,7 @@ /* By: umeneses +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/03 11:43:20 by umeneses #+# #+# */ -/* Updated: 2024/06/27 16:58:34 by umeneses ### ########.fr */ +/* Updated: 2024/06/28 12:27:49 by umeneses ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,7 +39,8 @@ bool ft_argv_is_not_duplicated(char **argv) { after_atoi = ft_atoi(argv[index]); future_pos = 1; - while ((++future_pos <= ft_argv_size(argv)) && (future_pos != index)) + while ((++future_pos <= ft_argv_size(argv)) && (future_pos != index) + && compare[future_pos] != NULL) { if (ft_atoi(compare[future_pos]) == after_atoi) return (false);