GCC Code Coverage Report


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

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** my_printf
4 ** File description:
5 ** Flag to print a %b (an int in binary)
6 */
7 /**
8 * @file flag_b.c
9 * @brief The file containing the flag_b function
10 * @author Nicolas TORO
11 */
12
13 #include "myprintf.h"
14
15 11 int flag_b(va_list list, formating_t *formating)
16 {
17 11 size_t temp = va_arg(list, size_t);
18 11 char *convert_base = specify_it_base(formating, temp, "01");
19
20 11 precise_it_int(convert_base, formating, temp);
21
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 10 times.
11 if (formating->id_ft == 3) {
22 1 my_revstr(convert_base);
23 1 my_strcat(convert_base, "b0");
24 1 my_revstr(convert_base);
25 }
26 11 format_it_int(convert_base, formating, temp);
27 11 return my_putstr_fd_free(convert_base, formating->fd);
28 }
29