42_minishell/libftx/printf/ft_putstr_fd.c

26 lines
1.1 KiB
C
Raw Normal View History

2023-01-31 08:40:15 -05:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/29 22:25:08 by cchauvet #+# #+# */
2023-02-03 10:02:52 -05:00
/* Updated: 2023/02/03 12:49:18 by cchauvet ### ########.fr */
2023-01-31 08:40:15 -05:00
/* */
/* ************************************************************************** */
#include "ft_printf.h"
2023-02-03 10:02:52 -05:00
int ft_putstr_fd_p(int fd, char *str)
2023-01-31 08:40:15 -05:00
{
int i;
if (str == NULL)
str = "(null)";
i = 0;
while (str[i] != '\0')
ft_putchar_fd(fd, str[i++]);
return (i);
}