Skip to content

Commit

Permalink
fixed print_i
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenni-Foued committed Nov 1, 2020
1 parent e6df96c commit a601bf8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion print_i.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ int print_i(va_list arg)
}
else
unb = nb;

if (unb > 0)
{
while (unb != 0)
{
tab[i] = (unb % 10) + '0';
Expand All @@ -33,5 +34,12 @@ int print_i(va_list arg)
i--;
count++;
}
}
else
{
_putchar('0');
count++;
}

return (count);
}

0 comments on commit a601bf8

Please sign in to comment.