diff --git a/ft_putnbr_fd.c b/ft_putnbr_fd.c index 18b3042..8c549e9 100644 --- a/ft_putnbr_fd.c +++ b/ft_putnbr_fd.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/05 10:22:16 by erey-bet #+# #+# */ -/* Updated: 2022/10/17 13:50:20 by erey-bet ### ########.fr */ +/* Updated: 2022/10/18 17:32:20 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,7 +18,8 @@ void ft_putnbr_fd(int n, int fd) long nl; nl = n; - nl *= ABS(nl); + if (nl < 0) + nl *= -1; len = ft_get_size(nl); if (n < 0) ft_putchar_fd('-', fd); diff --git a/libft.h b/libft.h index 5bf1b2a..aceddd6 100644 --- a/libft.h +++ b/libft.h @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/09/26 16:31:10 by erey-bet #+# #+# */ -/* Updated: 2022/10/11 22:44:32 by erey-bet ### ########.fr */ +/* Updated: 2022/10/18 17:32:25 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,6 @@ # define LIBFT_H # include # include -# define ABS(X) (X > 0) - (X < 0) typedef struct s_list {