aboutsummaryrefslogtreecommitdiff
path: root/convert_uint.c
diff options
context:
space:
mode:
Diffstat (limited to 'convert_uint.c')
-rw-r--r--convert_uint.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/convert_uint.c b/convert_uint.c
index bf28679..239e47d 100644
--- a/convert_uint.c
+++ b/convert_uint.c
@@ -3,15 +3,19 @@
char *convert_uint(va_list ap, t_pformat *pformat)
{
- unsigned int n;
+ long long unsigned int n;
if (pformat->flags & FLAG_SHORT)
- n = va_arg(ap, unsigned short);
+ n = va_arg(ap, int);
else if (pformat->flags & FLAG_SHORT_SHORT)
- n = va_arg(ap, unsigned char);
+ n = va_arg(ap, int);
+ else if (pformat->flags & FLAG_LONG)
+ n = va_arg(ap, long unsigned int);
+ else if (pformat->flags & FLAG_LONG_LONG)
+ n = va_arg(ap, long long unsigned int);
else
n = va_arg(ap, unsigned int);
- char *str = ft_itoa_base(n, "0123456789");
+ char *str = ft_itoa_unsigned_base(n, "0123456789");
str = handle_precision(pformat, str);
str = handle_padding(pformat, str);
return (str);