42_minishell/libftx/printf/ft_dprintstrtab.c
2023-02-17 16:33:52 +01:00

30 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_dprintstrtab.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/05 17:26:55 by cchauvet #+# #+# */
/* Updated: 2023/02/17 16:30:44 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_dprintstrtab(int fd, char **tab)
{
size_t index;
int i;
i = 0;
index = 0;
while (tab[index] != NULL)
{
i += ft_putstr_fd_p(fd, tab[index]) + 1;
ft_putchar_fd_p(fd, '\n');
index++;
}
return (i);
}