-
Notifications
You must be signed in to change notification settings - Fork 0
/
handle_unsigned.c
33 lines (29 loc) · 1.18 KB
/
handle_unsigned.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* handle_unsigned.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bde-koni <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/29 14:08:50 by bde-koni #+# #+# */
/* Updated: 2024/11/29 16:26:37 by bde-koni ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
size_t handle_unsigned(unsigned int u)
{
size_t count;
count = 0;
ft_putnbr_unsigned(u);
if (u == 0)
count += 1;
else
count += ft_lencheck((long)u);
return (count);
}
void ft_putnbr_unsigned(unsigned int u)
{
if (u >= 10)
ft_putnbr_unsigned(u / 10);
ft_putchar((u % 10) + '0');
}