GCC Code Coverage Report


Directory: ./
File: s21_strncmp.c
Date: 2025-05-31 00:37:53
Exec Total Coverage
Lines: 5 5 100.0%
Branches: 4 4 100.0%

Line Branch Exec Source
1 #include "s21_string.h"
2
3 5 int s21_strncmp(const char *str1, const char *str2, s21_size_t n){
4 5 int dif = 0;
5
4/4
✓ Branch 0 taken 20 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 18 times.
✓ Branch 3 taken 2 times.
23 for(s21_size_t i = 0; i < n && dif == 0; i++){
6 18 dif = str1[i] - str2[i];
7 }
8
9 5 return dif;
10 }
11