-
Notifications
You must be signed in to change notification settings - Fork 0
/
handler_u.c
33 lines (29 loc) · 1.33 KB
/
handler_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* handler_u.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmerabet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/12/09 20:18:17 by mmerabet #+# #+# */
/* Updated: 2017/12/10 23:08:34 by mmerabet ### ########.fr */
/* */
/* ************************************************************************** */
#include "handlers.h"
char *handler_u(va_list lst, t_printf_params params)
{
unsigned long long n;
char *str;
n = proper_cast_u(lst, params);
if (params.precision_spec && params.precision == 0 && n == 0)
str = ft_strnew(0);
else
str = ft_ulltoa(n);
return (perform_width(pad_zeroes(str, ¶ms), ¶ms));
}
char *handler_u_m(va_list lst, t_printf_params params)
{
params.flags[LL_MOD] = 0;
params.flags[L_MOD] = 1;
return (handler_u(lst, params));
}