diff options
Diffstat (limited to 'ft_putstr_fd.c')
| -rw-r--r-- | ft_putstr_fd.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 <unistd.h> +#include <limits.h> void ft_putstr_fd(char *s, int fd) { + if (s == NULL || fd < 0 || fd > OPEN_MAX) + return ; while (*s) write(fd, s++, 1); } |
