-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathft_putendl_fd.c
30 lines (27 loc) · 1.12 KB
/
ft_putendl_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
26
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putendl_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adiaz-lo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/13 12:00:40 by adiaz-lo #+# #+# */
/* Updated: 2020/01/13 12:04:23 by adiaz-lo ### ########.fr */
/* */
/* ************************************************************************** */
/*
** This function outputs the string 's' to the given file descriptor 'fd',
** followed by a newline.
*/
#include "libft.h"
void ft_putendl_fd(char *s, int fd)
{
if (!s)
return ;
while (*s)
{
write(fd, s, 1);
s++;
}
write(fd, "\n", 1);
}