Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_printf | ||
4 | ** File description: | ||
5 | ** The functions for precise an int | ||
6 | */ | ||
7 | |||
8 | #include <stddef.h> | ||
9 | #include "my.h" | ||
10 | #include "myformats.h" | ||
11 | |||
12 | 99 | void precise_it_int(char *str_finale, | |
13 | formating_t *formating, size_t nb) | ||
14 | { | ||
15 | 99 | int precision = formating->id_nb; | |
16 | |||
17 |
4/4✓ Branch 0 taken 98 times.
✓ Branch 1 taken 1 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 96 times.
|
99 | if (precision != 0 && my_strlen(str_finale) < precision) { |
18 | 2 | my_revstr(str_finale); | |
19 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 2 taken 2 times.
|
7 | for (int i = my_strlen(str_finale); i < precision; i++) { |
20 | 5 | my_strcat(str_finale, "0"); | |
21 | } | ||
22 | 2 | my_revstr(str_finale); | |
23 |
3/4✓ Branch 0 taken 1 times.
✓ Branch 1 taken 96 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
97 | } else if (precision == 0 && nb == '\0') { |
24 | 1 | str_finale[0] = '\0'; | |
25 | } | ||
26 | 99 | } | |
27 |