| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | ** EPITECH PROJECT, 2024 | ||
| 3 | ** my_memset | ||
| 4 | ** File description: | ||
| 5 | ** Fills the first (size) bytes of the memory area pointed to by (pointer) | ||
| 6 | ** with the constant byte (value) | ||
| 7 | */ | ||
| 8 | /** | ||
| 9 | * @file my_memset.c | ||
| 10 | * @brief The file containing the my_memset function | ||
| 11 | * @author Nicolas TORO | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include "mymemory.h" | ||
| 15 | |||
| 16 | 3184 | void *my_memset(void *pointer, int value, size_t size) | |
| 17 | { | ||
| 18 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3183 times.
|
3184 | if (pointer == NULL) |
| 19 | 1 | return NULL; | |
| 20 |
2/2✓ Branch 0 taken 126486 times.
✓ Branch 1 taken 3183 times.
|
129669 | for (size_t i = 0; i < size; i++) |
| 21 | 126486 | ((char *)pointer)[i] = value; | |
| 22 | 3183 | return pointer; | |
| 23 | } | ||
| 24 |