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_putstr_fd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ft_putstr_fd.c') diff --git a/ft_putstr_fd.c b/ft_putstr_fd.c index 22028b7..1f2bbda 100644 --- a/ft_putstr_fd.c +++ b/ft_putstr_fd.c @@ -11,9 +11,12 @@ /* ************************************************************************** */ #include +#include void ft_putstr_fd(char *s, int fd) { + if (s == NULL || fd < 0 || fd > OPEN_MAX) + return ; while (*s) write(fd, s++, 1); } -- cgit