ft_putchar.c 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_putchar.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2015/11/25 16:39:02 by bchanot #+# #+# */
  9. /* Updated: 2017/04/15 00:35:26 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "libft.h"
  13. #include <unistd.h>
  14. int ft_putchar_fd(int c, int fd)
  15. {
  16. if (!c)
  17. return (false);
  18. write(fd, &c, 1);
  19. return (true);
  20. }
  21. int ft_putchar(int c)
  22. {
  23. if (!c)
  24. return (false);
  25. write(1, &c, 1);
  26. return (true);
  27. }