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_putnbr_fd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ft_putnbr_fd.c') diff --git a/ft_putnbr_fd.c b/ft_putnbr_fd.c index db91e06..562d289 100644 --- a/ft_putnbr_fd.c +++ b/ft_putnbr_fd.c @@ -11,12 +11,15 @@ /* ************************************************************************** */ #include +#include #include "libft.h" void ft_putnbr_fd(int n, int fd) { unsigned int p_n; + if (fd < 0 || fd > OPEN_MAX) + return ; p_n = n; if (n < 0) { -- cgit