From 0cf7761bf2985f683b1b73dfe5bdb731672e2b7f Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 21 Oct 2019 20:25:32 +0200 Subject: Added protection on part2 and changed lstmap according to the subject --- ft_putendl_fd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ft_putendl_fd.c') diff --git a/ft_putendl_fd.c b/ft_putendl_fd.c index d9f6d7d..8b77884 100644 --- a/ft_putendl_fd.c +++ b/ft_putendl_fd.c @@ -10,10 +10,13 @@ /* */ /* ************************************************************************** */ +#include #include "libft.h" void ft_putendl_fd(char *s, int fd) { + if (s == NULL || fd < 0 || fd > OPEN_MAX) + return ; ft_putstr_fd(s, fd); ft_putchar_fd('\n', fd); } -- cgit