-
Notifications
You must be signed in to change notification settings - Fork 0
/
process_u.c
43 lines (38 loc) · 1.28 KB
/
process_u.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
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* process_u.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: igilbert <[email protected]. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/14 10:56:04 by igilbert #+# #+# */
/* Updated: 2024/11/14 14:02:25 by igilbert ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putnbr_long(long nb)
{
int len;
len = 0;
if (nb < 0)
{
len += ft_putchar('-');
nb *= -1;
}
if (nb >= 10)
{
len += ft_putnbr(nb / 10);
len += ft_putchar(nb % 10 + '0');
}
else
len += ft_putchar(nb + '0');
return (len);
}
int process_u(va_list args)
{
unsigned int nb;
int len;
nb = va_arg(args, unsigned int);
len = ft_putnbr_long(nb);
return (len);
}