GCC Code Coverage Report


Directory: ./
File: lib/my/my_strncat.c
Date: 2024-06-05 00:29:21
Exec Total Coverage
Lines: 8 8 100.0%
Functions: 1 1 100.0%
Branches: 2 2 100.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** my_strncat
4 ** File description:
5 ** Concatenates a string (dest) with another string (src)
6 ** with a defined size (n) and returns the destination string (dest)
7 */
8
9 #include "my.h"
10
11 1 char *my_strncat(char *dest, char const *src, int n)
12 {
13 1 int len_dest = my_strlen(dest);
14 1 int len_src = n;
15 1 int i = 0;
16
17
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 times.
3 for (i = 0; i < len_src; i++) {
18 2 dest[len_dest + i] = src[i];
19 }
20 1 dest[len_dest + i] = '\0';
21 1 return dest;
22 }
23