From 7326e33f9221a8cf55c7e15eb58e7a4caf64cc03 Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Mon, 20 Feb 2017 18:19:59 +0100 Subject: [PATCH] put_endl_fd, deso deso wescande --- libft/includes/libft.h | 2 +- libft/src/lst/push.c | 2 +- libft/src/printing/ft_putendl.c | 13 +++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libft/includes/libft.h b/libft/includes/libft.h index c168e1f4..69766db5 100644 --- a/libft/includes/libft.h +++ b/libft/includes/libft.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */ -/* Updated: 2017/02/18 18:48:49 by jhalford ### ########.fr */ +/* Updated: 2017/02/20 17:25:39 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/lst/push.c b/libft/src/lst/push.c index e13ac8f1..a99f77aa 100644 --- a/libft/src/lst/push.c +++ b/libft/src/lst/push.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/09 15:59:39 by jhalford #+# #+# */ -/* Updated: 2017/02/10 00:28:45 by jhalford ### ########.fr */ +/* Updated: 2017/02/20 17:19:25 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/printing/ft_putendl.c b/libft/src/printing/ft_putendl.c index a0fc0b6b..f54881d8 100644 --- a/libft/src/printing/ft_putendl.c +++ b/libft/src/printing/ft_putendl.c @@ -6,17 +6,22 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 14:57:40 by jhalford #+# #+# */ -/* Updated: 2016/11/03 14:57:41 by jhalford ### ########.fr */ +/* Updated: 2017/02/20 18:17:01 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" -void ft_putendl(char const *s) +void ft_putendl_fd(char const *s, int fd) { char nl; nl = '\n'; - write(1, s, ft_strlen(s)); - write(1, &nl, 1); + write(fd, s, ft_strlen(s)); + write(fd, &nl, 1); +} + +void ft_putendl(char const *s) +{ + ft_putendl_fd(s, 1); }