From 9af2885d872de9c60b11159efe0685738031096d Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 14 Feb 2020 03:46:08 +0100 Subject: Added documentation for all functions and refactored ft_strjoin_free -> ft_strjoinf --- src/str/ft_itoa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/str/ft_itoa.c') diff --git a/src/str/ft_itoa.c b/src/str/ft_itoa.c index 166e278..39b6e12 100644 --- a/src/str/ft_itoa.c +++ b/src/str/ft_itoa.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/07 10:19:56 by cacharle #+# #+# */ -/* Updated: 2019/11/20 03:13:10 by cacharle ### ########.fr */ +/* Updated: 2020/02/14 03:39:11 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,8 +25,9 @@ char *ft_itoa(int n) u_nbr /= 10; len++; } - if ((str = ft_strnew(len)) == NULL) + if ((str = (char*)malloc(sizeof(char) * (len + 1))) == NULL) return (NULL); + str[len] = '\0'; u_nbr = n < 0 ? -n : n; if (n < 0) str[0] = '-'; -- cgit