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