/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_getchar.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/06/15 18:46:16 by bchanot #+# #+# */ /* Updated: 2016/11/08 11:03:34 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" #include int ft_getchar_fd(int fd) { char c; if (read(fd, &c, 1) != 1) return (-1); return ((int)c); } int ft_getchar(void) { return (ft_getchar_fd(0)); }