aboutsummaryrefslogtreecommitdiff
path: root/src/io/ft_getchar.c
blob: 9d233c034863c78c22d03533ebfb908123af845c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_getchar.c                                       :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: cacharle <marvin@42.fr>                    +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/01/18 10:29:54 by cacharle          #+#    #+#             */
/*   Updated: 2020/02/14 02:24:56 by cacharle         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "libft.h"

char	ft_getchar(void)
{
	char	c;

	if (read(STDIN_FILENO, &c, 1) < 0)
		return (-1);
	return (c);
}