-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lputstr_fd.c
25 lines (22 loc) · 1.14 KB
/
ft_lputstr_fd.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lputstr_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jovicto2 <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/06/24 00:45:07 by jovicto2 #+# #+# */
/* Updated: 2023/06/24 04:48:04 by jovicto2 ### ########.fr */
/* */
/* ************************************************************************** */
#include "../includes/libft.h"
size_t ft_lputstr_fd(char *s, int fd)
{
size_t written_bytes;
written_bytes = 0;
if (!s)
return (write(fd, NULL_STRING, ft_strlen(NULL_STRING)));
while (*s)
written_bytes += write(fd, s++, sizeof(char));
return (written_bytes);
}