corrected ft_putnbr_fd 10x problem
This commit is contained in:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user