diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-02-10 02:22:33 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-02-10 02:22:33 +0100 |
| commit | 48f43e34e9beafbc76a85c6f6874aae051981c72 (patch) | |
| tree | 6bc73d0537019932fd0478fc074de2d235134002 /src/io/ft_getchar.c | |
| parent | 0acdc4fec5cae4e619d0f4f8bd67e171bffa110e (diff) | |
| parent | a5b068767440327f910dfa815be12ff4c0d94309 (diff) | |
| download | libft-48f43e34e9beafbc76a85c6f6874aae051981c72.tar.gz libft-48f43e34e9beafbc76a85c6f6874aae051981c72.tar.bz2 libft-48f43e34e9beafbc76a85c6f6874aae051981c72.zip | |
Merge branch 'push_swap'
Diffstat (limited to 'src/io/ft_getchar.c')
| -rw-r--r-- | src/io/ft_getchar.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/io/ft_getchar.c b/src/io/ft_getchar.c new file mode 100644 index 0000000..54b44d4 --- /dev/null +++ b/src/io/ft_getchar.c @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_getchar.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/01/18 10:29:54 by cacharle #+# #+# */ +/* Updated: 2020/01/18 10:46:56 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char ft_getchar(void) +{ + char c; + + if (read(STDIN_FILENO, &c, 1) < 0) + return (-1); + return (c); +} |
