GCC Code Coverage Report


Directory: ./
File: lib/my/my_strcat.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_strcat
4 ** File description:
5 ** Concatenates a string (dest) with another string (src)
6 ** and returns the destination string (dest)
7 */
8
9 #include "my.h"
10
11 955 char *my_strcat(char *dest, char const *src)
12 {
13 955 int len_dest = my_strlen(dest);
14 955 int len_src = my_strlen(src);
15 955 int i = 0;
16
17
2/2
✓ Branch 0 taken 1379 times.
✓ Branch 1 taken 955 times.
2334 for (i = 0; i < len_src; i++) {
18 1379 dest[len_dest + i] = src[i];
19 }
20 955 dest[len_dest + i] = '\0';
21 955 return dest;
22 }
23