From c8a5f03103ac70d6525cab05ac85312099336989 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 25 Aug 2020 23:33:27 +0200 Subject: qweqwe --- src/b_sqb.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/b_sqb.c b/src/b_sqb.c index 91bf7b6..28e0fa6 100644 --- a/src/b_sqb.c +++ b/src/b_sqb.c @@ -25,26 +25,24 @@ static void } static uint8_t - b_get_sqb_id(uint64_t argc, - char *argv[], + b_get_sqb_id(char *argv[], t_msh *msh) { - size_t j; uint8_t i; i = 0; while (i < FT_ID_SQB_COUNT) { - j = 0; - while (j < argc) - { - if ( - ft_strncmp(argv[j], + if (i < FT_ID_SQB_NT && + ft_strncmp(argv[0], msh->sqb_ref[i], ft_strlen(msh->sqb_ref[i]) + 1) == 0) - return (i); - j++; - } + return (i); + if (i >= FT_ID_SQB_NT && + ft_strncmp(argv[1], + msh->sqb_ref[i], + ft_strlen(msh->sqb_ref[i]) + 1) == 0) + return (i); i++; } return (i); @@ -57,13 +55,13 @@ static uint8_t { uint8_t id; - id = b_get_sqb_id(argc, argv, msh); + (void)argc; + id = b_get_sqb_id(argv, msh); if (id == FT_ID_SQB_COUNT) { b_sqb_unexpected_operator(argv[0]); return (2); } - ft_printf("[%s]\n", msh->sqb_ref[id]); return (0); } -- cgit v1.2.3