From 66635d69fa00e335a091d7e6f2b358cbaaf205e4 Mon Sep 17 00:00:00 2001 From: Cabergs Charles Date: Tue, 16 Jul 2019 12:58:13 +0200 Subject: c09 passed, c10 start, exam00 and exam01 --- c10/ex01/helper.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 c10/ex01/helper.c (limited to 'c10/ex01/helper.c') diff --git a/c10/ex01/helper.c b/c10/ex01/helper.c new file mode 100644 index 0000000..8a1c13e --- /dev/null +++ b/c10/ex01/helper.c @@ -0,0 +1,35 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* helper.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/07/16 10:14:16 by cacharle #+# #+# */ +/* Updated: 2019/07/16 10:26:44 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include "include.h" + +void ft_putstr_err(char *str) +{ + while (*str) + write(STDERR_FILENO, str++, 1); +} + +void handle_error(char *program_name, char *arg) +{ + char *error_msg; + + ft_putstr_err(program_name); + ft_putstr_err(": "); + ft_putstr_err(arg); + ft_putstr_err(": "); + error_msg = strerror(errno); + ft_putstr_err(error_msg); + ft_putstr_err("\n"); +} -- cgit