-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putstr_fd.c
31 lines (28 loc) · 1.08 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
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: potero-d <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/23 13:30:29 by potero-d #+# #+# */
/* Updated: 2021/10/27 16:04:10 by potero-d ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putstr_fd(char *s, int fd)
{
int i;
i = 0;
if (s == 0)
{
write(1, "(null)", 6);
return (6);
}
while (s[i] != '\0')
{
ft_putchar_fd(s[i], fd);
i++;
}
return (i);
}