| 1234567891011121314151617181920212223 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_getchar.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2016/06/15 18:46:16 by bchanot #+# #+# */
- /* Updated: 2017/11/13 15:31:49 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libft.h"
- #include <unistd.h>
- int ft_getchar(int fd)
- {
- char c;
- if (read(fd, &c, 1) != 1)
- return (-1);
- return ((int)c);
- }
|