Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_strupcase | ||
4 | ** File description: | ||
5 | ** Replaces upcase by lowcase of a string (str) and returns them | ||
6 | */ | ||
7 | |||
8 | 1 | char *my_strupcase(char *str) | |
9 | { | ||
10 | 1 | int len = 0; | |
11 | |||
12 |
2/2✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 times.
|
7 | while (str[len] != '\0') { |
13 | 6 | len = len + 1; | |
14 | } | ||
15 |
2/2✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 times.
|
7 | for (int i = 0; i < len; i++) { |
16 |
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) { |
17 | 5 | str[i] = str[i] - 32; | |
18 | } | ||
19 | } | ||
20 | 1 | return str; | |
21 | } | ||
22 |