GCC Code Coverage Report


Directory: ./
File: s21_memchr.c
Date: 2025-05-31 00:37:53
Exec Total Coverage
Lines: 7 7 100.0%
Branches: 6 6 100.0%

Line Branch Exec Source
1 #include "s21_string.h"
2
3 6 void *s21_memchr(const void *str, int c, s21_size_t n){
4 6 unsigned char *mas = (unsigned char*)str;
5 6 void *result = S21_NULL;
6
4/4
✓ Branch 0 taken 55 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 53 times.
✓ Branch 3 taken 2 times.
59 for(s21_size_t i = 0; i < n && result == S21_NULL; i++){
7
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 50 times.
53 if(mas[i] == c){
8 3 result = mas + i;
9 }
10 }
11
12 6 return result;
13 }
14