-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_putnendl_fd.c
24 lines (21 loc) · 1.07 KB
/
ft_putnendl_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putnendl_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vbrazas <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/03/02 20:29:36 by vbrazas #+# #+# */
/* Updated: 2018/03/02 20:41:08 by vbrazas ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
ssize_t ft_putnendl_fd(char const *s, int fd, size_t len)
{
ssize_t endlen;
if (!s)
return (0);
endlen = write(fd, s, len);
endlen += write(fd, "\n", 1);
return (endlen);
}