From 0988a2c8ab41035debd8046d2d857011e9f14a12 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 5 Sep 2025 15:09:35 +0200 Subject: [PATCH] fix(convert/atoi): atoi was now working with NULL parameters - Now fixed by the verification before --- convert/ft_atoi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/convert/ft_atoi.c b/convert/ft_atoi.c index d7eccaa..ba63e8d 100644 --- a/convert/ft_atoi.c +++ b/convert/ft_atoi.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/08 17:22:41 by rparodi #+# #+# */ -/* Updated: 2025/09/04 11:39:58 by rparodi ### ########.fr */ +/* Updated: 2025/09/05 14:34:51 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,6 +43,8 @@ int ft_atoi(const char *nptr) int sign; int number; + if (!nptr) + return (0); i = 0; sign = ft_check_sign(nptr, &i); number = 0;