| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | ** EPITECH PROJECT, 2023 | ||
| 3 | ** my_putstr_limited | ||
| 4 | ** File description: | ||
| 5 | ** Write a string (str) in stdout with a defined size (size) | ||
| 6 | ** and returns the length of the printed string | ||
| 7 | */ | ||
| 8 | /** | ||
| 9 | * @file my_putstr_sized.c | ||
| 10 | * @brief The file containing the my_putstr_sized function | ||
| 11 | * @author Nicolas TORO | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include "my.h" | ||
| 15 | |||
| 16 | 2 | int my_putstr_sized(char const *str, int size) | |
| 17 | { | ||
| 18 |
3/4✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
|
2 | if (str == NULL || size < 1) |
| 19 | 1 | return 0; | |
| 20 | 1 | write(1, str, size); | |
| 21 | 1 | return size; | |
| 22 | } | ||
| 23 |