aboutsummaryrefslogtreecommitdiff
path: root/convert_hex_up.c
blob: 7f5e640e54d4dc896d590fb6d3b08767e107781f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdarg.h>
#include "header.h"

char	*convert_hex_up(va_list ap, t_pformat *pformat)
{
	unsigned int n = va_arg(ap, unsigned int);
	char *str = ITOA_HEX_UP(n);
	str = handle_precision(pformat, str);
	if (pformat->flags & FLAG_ALTERNATE)
	{
		char *tmp = ft_strjoin("0X", str);
		free(str);
		str = tmp;
	}
	str = handle_padding(pformat, str);
	return (str);
}