GCC Code Coverage Report


Directory: ./
File: lib/my/my_putstr_fd_free.c
Date: 2024-06-05 00:36:48
Exec Total Coverage
Lines: 7 7 100.0%
Functions: 1 1 100.0%
Branches: 3 4 75.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2024
3 ** my_putstr_fd_free
4 ** File description:
5 ** Write a string (str) in a file descriptor (fd), free it
6 ** and returns the length of the printed string
7 */
8 /**
9 * @file my_putstr_fd_free.c
10 * @brief The file containing the my_putstr_fd_free function
11 * @author Nicolas TORO
12 */
13
14 #include "my.h"
15
16 213 int my_putstr_fd_free(char *str, int fd)
17 {
18 int len;
19
20
3/4
✓ Branch 0 taken 212 times.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 212 times.
213 if (str == NULL || fd < 0)
21 1 return 0;
22 212 len = my_strlen(str);
23 212 write(fd, str, len);
24 212 FREE(str);
25 212 return len;
26 }
27