GCC Code Coverage Report


Directory: ./
File: lib/mymemory/my_memset.c
Date: 2024-06-05 00:34:38
Exec Total Coverage
Lines: 6 6 100.0%
Functions: 1 1 100.0%
Branches: 4 4 100.0%

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