-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putendl_fd.c
33 lines (30 loc) · 1.18 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
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putendl_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dalves-p <dalves-p@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/05/18 21:41:16 by dalves-p #+# #+# */
/* Updated: 2021/06/29 11:37:03 by dalves-p ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** LIBRARY: N/A
** DESCRIPTION:
** The ft_putendl_fd() function outputs the string ’s’ to the given file
** descriptor, followed by a newline.
*/
void ft_putendl_fd(char *s, int fd)
{
if (s != NULL)
{
while (*s != '\0')
{
write(fd, s, 1);
s++;
}
write(fd, "\n", 1);
}
}