corrected ft_putnbr_fd 10x problem

This commit is contained in:
Tanguy MAZE
2018-04-24 14:58:23 +02:00
parent 4f3eb001b9
commit 8cb3375f32

View File

@@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */ /* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/08 13:05:24 by tmaze #+# #+# */ /* Created: 2018/04/08 13:05:24 by tmaze #+# #+# */
/* Updated: 2018/04/08 15:41:23 by tmaze ### ########.fr */ /* Updated: 2018/04/24 14:57:24 by tmaze ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -27,7 +27,7 @@ void ft_putnbr_fd(int n, int fd)
mult = 10; mult = 10;
nbr = ft_abs(n); nbr = ft_abs(n);
while (mult < nbr) while (mult <= nbr)
mult *= 10; mult *= 10;
if (n < 0) if (n < 0)
write(fd, "-", 1); write(fd, "-", 1);