| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | ** EPITECH PROJECT, 2023 | ||
| 3 | ** my_strlen | ||
| 4 | ** File description: | ||
| 5 | ** Returns the length of a string (str) | ||
| 6 | */ | ||
| 7 | /** | ||
| 8 | * @file my_strlen.c | ||
| 9 | * @brief The file containing the my_strlen function | ||
| 10 | * @author Nicolas TORO | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include "my.h" | ||
| 14 | |||
| 15 | 1285714 | int my_strlen(char const *str) | |
| 16 | { | ||
| 17 | 1285714 | int len = 0; | |
| 18 | |||
| 19 |
2/2✓ Branch 0 taken 38367 times.
✓ Branch 1 taken 1247347 times.
|
1285714 | if (str == NULL) |
| 20 | 38367 | return 0; | |
| 21 |
2/2✓ Branch 0 taken 15089072 times.
✓ Branch 1 taken 1247347 times.
|
16336419 | while (str[len] != '\0') |
| 22 | 15089072 | len = len + 1; | |
| 23 | 1247347 | return len; | |
| 24 | } | ||
| 25 |