ft_putstr.c 1.1 KB

1234567891011121314151617181920212223242526
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_putstr.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2015/11/25 16:39:48 by bchanot #+# #+# */
  9. /* Updated: 2018/10/29 12:13:53 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "libft.h"
  13. #include <unistd.h>
  14. void ft_putstr_fd(const char *const s, int fd)
  15. {
  16. if (s && fd >= 0)
  17. write(fd, s, ft_strlen(s));
  18. }
  19. void ft_putstr(const char *const s)
  20. {
  21. if (s)
  22. write(1, s, ft_strlen(s));
  23. }