aboutsummaryrefslogtreecommitdiff
path: root/c04/ex02
diff options
context:
space:
mode:
Diffstat (limited to 'c04/ex02')
-rw-r--r--c04/ex02/ft_putnbr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/c04/ex02/ft_putnbr.c b/c04/ex02/ft_putnbr.c
index 8a13dc5..4ba6a0e 100644
--- a/c04/ex02/ft_putnbr.c
+++ b/c04/ex02/ft_putnbr.c
@@ -6,7 +6,7 @@
/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/07/06 07:24:04 by cacharle #+# #+# */
-/* Updated: 2019/07/06 08:34:48 by cacharle ### ########.fr */
+/* Updated: 2019/07/06 08:47:01 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -23,6 +23,11 @@ void ft_putnbr(int nb)
int rev_digits[100];
unsigned int nbu;
+ if (nb == 0)
+ {
+ ft_putchar('0');
+ return;
+ }
if (nb < 0)
{
ft_putchar('-');