From dcd2a41e545cbee2a4487e28f684d19f9aa79877 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 26 Aug 2020 18:17:02 +0200 Subject: Err check in progress --- src/b_sqb.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/b_sqb.c') diff --git a/src/b_sqb.c b/src/b_sqb.c index fb52e00..a5a0fd5 100644 --- a/src/b_sqb.c +++ b/src/b_sqb.c @@ -14,6 +14,7 @@ #include #include +#include "b_sqb_err.h" #include "b_sqb_file.h" #include "b_sqb_nbr.h" #include "b_sqb_str.h" @@ -21,12 +22,6 @@ #include "s_struct.h" #include "u_utils.h" -static void - b_sqb_unexpected_operator(const char op[]) -{ - ft_dprintf(STDERR_FILENO, "[: %s: unexpected operator\n", op); -} - static uint8_t b_get_sqb_id(char *argv[], t_msh *msh) @@ -61,10 +56,11 @@ static uint8_t id = b_get_sqb_id(argv, msh); if (id == FT_ID_SQB_COUNT) { - b_sqb_unexpected_operator(argv[0]); + ft_dprintf(STDERR_FILENO, "[: %s: unexpected operator\n", argv[0]); return (2); } - /* TODO: check errors */ + if (b_sqb_err_check(id, argv) != 0) + return (2); ret = 0; if (id < FT_ID_SQB_NT && id != FT_ID_SQB_Z && id != FT_ID_SQB_N) ret = b_sqb_file_tests(id, argv); -- cgit v1.2.3