aboutsummaryrefslogtreecommitdiff
path: root/ft_putendl_fd.c
diff options
context:
space:
mode:
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);
}