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 | 2873 | void *my_memset(void *pointer, int value, size_t size) | |
17 | { | ||
18 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 2872 times.
|
2873 | if (pointer == NULL) |
19 | 1 | return NULL; | |
20 |
2/2✓ Branch 0 taken 253005 times.
✓ Branch 1 taken 2872 times.
|
255877 | for (size_t i = 0; i < size; i++) |
21 | 253005 | ((char *)pointer)[i] = value; | |
22 | 2872 | return pointer; | |
23 | } | ||
24 |