| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | ** EPITECH PROJECT, 2024 | ||
| 3 | ** my_memcmp | ||
| 4 | ** File description: | ||
| 5 | ** The my_memcmp.c | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include "mymemory.h" | ||
| 9 | |||
| 10 | 3 | int my_memcmp(const void *pointer1, const void *pointer2, size_t size) | |
| 11 | { | ||
| 12 |
3/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
|
3 | if (pointer1 == NULL || pointer2 == NULL) |
| 13 | 1 | return 0; | |
| 14 |
2/2✓ Branch 0 taken 11 times.
✓ Branch 1 taken 1 times.
|
12 | for (size_t index = 0; index < size; index++) { |
| 15 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 10 times.
|
11 | if (((char *)pointer1)[index] != ((char *)pointer2)[index]) |
| 16 | 1 | return ((char *)pointer1)[index] - ((char *)pointer2)[index]; | |
| 17 | } | ||
| 18 | 1 | return 0; | |
| 19 | } | ||
| 20 |