Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_strupcase | ||
4 | ** File description: | ||
5 | ** Replaces lowcase by upcase of a string (str) and returns them | ||
6 | */ | ||
7 | /** | ||
8 | * @file my_strupcase.c | ||
9 | * @brief The file containing the my_strupcase function | ||
10 | * @author Nicolas TORO | ||
11 | */ | ||
12 | |||
13 | #include "my.h" | ||
14 | |||
15 | 1 | char *my_strupcase(char *str) | |
16 | { | ||
17 |
2/2✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 times.
|
7 | for (int i = 0; str[i] != '\0'; i++) { |
18 |
3/4✓ Branch 0 taken 5 times.
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 5 times.
✗ Branch 3 not taken.
|
6 | if (str[i] >= 97 && str[i] <= 122) { |
19 | 5 | str[i] = str[i] - 32; | |
20 | } | ||
21 | } | ||
22 | 1 | return str; | |
23 | } | ||
24 |