-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putstr_fd.c
29 lines (25 loc) · 1.11 KB
/
ft_putstr_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bnidia <bnidia@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/17 14:38:37 by bnidia #+# #+# */
/* Updated: 2021/10/25 19:46:55 by bnidia ### ########.fr */
/* */
/* ************************************************************************** */
/* ft_putstr_fd
** Outputs the string 's' to the given file descriptor
**
*/
#include "libft.h"
void ft_putstr_fd(char *s, int fd)
{
size_t len;
ssize_t err;
len = ft_strlen(s);
err = write(fd, s, len);
if (err == -1)
err = 0;
}