Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_printf | ||
4 | ** File description: | ||
5 | ** The functions for apply format to a char | ||
6 | */ | ||
7 | /** | ||
8 | * @file format_it_char.c | ||
9 | * @brief The file containing the format_it_char function | ||
10 | * @author Nicolas TORO | ||
11 | */ | ||
12 | |||
13 | #include "myprintf.h" | ||
14 | |||
15 | 17 | void format_it_char(char *str_finale, | |
16 | formating_t *formating, char c) | ||
17 | { | ||
18 | 17 | void (*format[])(char *, formating_t *, char c) = | |
19 | {&format_moins_char, &format_plus_char, | ||
20 | &format_esp_char, &format_hash_char, &format_zero_char}; | ||
21 | |||
22 |
4/4✓ Branch 0 taken 10 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 9 times.
|
17 | if (formating->id_ft == -1 && formating->id_wd != -1) { |
23 | 1 | format[2](str_finale, formating, c); | |
24 | } | ||
25 |
2/2✓ Branch 0 taken 85 times.
✓ Branch 1 taken 17 times.
|
102 | for (int i = 0; i < 5; i++) { |
26 |
2/2✓ Branch 0 taken 7 times.
✓ Branch 1 taken 78 times.
|
85 | if (formating->id_ft == i) { |
27 | 7 | format[i](str_finale, formating, c); | |
28 | } | ||
29 | } | ||
30 | 17 | return; | |
31 | } | ||
32 |