aboutsummaryrefslogtreecommitdiff
path: root/ft_putendl_fd.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-10-21 20:25:32 +0200
committerCharles <sircharlesaze@gmail.com>2019-10-21 20:25:32 +0200
commit0cf7761bf2985f683b1b73dfe5bdb731672e2b7f (patch)
tree3aff24216409fa5ac313b2ff686f3e23ba9493ff /ft_putendl_fd.c
parent70a7a3a54d4e300c7ec75d18d14d6d6b174c9ee4 (diff)
downloadlibft-0cf7761bf2985f683b1b73dfe5bdb731672e2b7f.tar.gz
libft-0cf7761bf2985f683b1b73dfe5bdb731672e2b7f.tar.bz2
libft-0cf7761bf2985f683b1b73dfe5bdb731672e2b7f.zip
Added protection on part2 and changed lstmap according to the subject
Diffstat (limited to 'ft_putendl_fd.c')
-rw-r--r--ft_putendl_fd.c3
1 files changed, 3 insertions, 0 deletions
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 <limits.h>
#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);
}