42_ft_printf/ft_putstr_fd.c

26 lines
1.1 KiB
C
Raw Normal View History

2022-10-06 20:30:03 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/29 22:25:08 by cchauvet #+# #+# */
2022-10-23 13:01:50 -04:00
/* Updated: 2022/10/12 16:51:51 by cchauvet ### ########.fr */
2022-10-06 20:30:03 -04:00
/* */
/* ************************************************************************** */
2022-10-23 13:01:50 -04:00
#include "ft_printf.h"
2022-10-06 20:30:03 -04:00
2022-10-23 13:01:50 -04:00
int ft_putstr_fd(int fd, char *str)
2022-10-06 20:30:03 -04:00
{
2022-10-23 13:01:50 -04:00
int i;
if (str == NULL)
str = "(null)";
i = 0;
while (str[i] != '\0')
ft_putchar_fd(fd, str[i++]);
return (i);
2022-10-06 20:30:03 -04:00
}