GCC Code Coverage Report


Directory: ./
File: lib/my/my_printf/flag_p.c
Date: 2024-06-05 00:36:48
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** my_printf
4 ** File description:
5 ** Flag to print %p (an address in hexadecimal)
6 */
7 /**
8 * @file flag_p.c
9 * @brief The file containing the flag_p function
10 * @author Nicolas TORO
11 */
12
13 #include "myprintf.h"
14
15 4 int flag_p(va_list list, formating_t *formating)
16 {
17 4 unsigned long int temp = va_arg(list, unsigned long int);
18 4 char *address_hexa = my_str_nbr_base_unsigned(temp, "0123456789abcdef");
19
20 4 precise_it_int(address_hexa, formating, temp);
21 4 my_revstr(address_hexa);
22 4 my_strcat(address_hexa, "x0");
23 4 my_revstr(address_hexa);
24 4 format_it_int(address_hexa, formating, temp);
25 4 return my_putstr_fd_free(address_hexa, formating->fd);
26 }
27