From e0f584fd30241520109727619447ce6b19f002b1 Mon Sep 17 00:00:00 2001 From: Tanguy MAZE Date: Mon, 18 Mar 2019 14:42:32 +0100 Subject: [PATCH] ...seems ok this time ^^" corrected stack checker in checker --- Makefile | 3 ++- srcs/checker.c | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 93e07c2..f70e64a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: tmaze +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2019/02/23 14:30:57 by tmaze #+# #+# # -# Updated: 2019/03/17 15:11:39 by tmaze ### ########.fr # +# Updated: 2019/03/18 14:27:44 by tmaze ### ########.fr # # # #******************************************************************************# @@ -103,6 +103,7 @@ clean : fclean : clean @echo -e "$(RED)===> $(GRE)$(NAME) : $(RED) Delete Binary File <===$(DEF)" @$(RM) -f $(NAME1) $(NAME2) + @$(RM) -rf *.dSYM @$(MAKE) -C $(LIBDIR) fclean re : fclean default diff --git a/srcs/checker.c b/srcs/checker.c index e231f14..e065a28 100644 --- a/srcs/checker.c +++ b/srcs/checker.c @@ -6,7 +6,7 @@ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/23 13:35:15 by tmaze #+# #+# */ -/* Updated: 2019/03/17 17:24:43 by tmaze ### ########.fr */ +/* Updated: 2019/03/18 12:28:54 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ @@ -46,7 +46,7 @@ void exec_actions(t_psdata *data) nop = data->op; while (nop && (buff = (char*)nop->content)) { - if (ft_strcmp(buff, "rra") == 0 || ft_strcmp(buff, "rrn") == 0) + if (ft_strcmp(buff, "rra") == 0 || ft_strcmp(buff, "rrb") == 0) ps_rerot(data, buff[2]); else if (ft_strcmp(buff, "rrr") == 0) ps_rrerot(data); @@ -98,9 +98,10 @@ void check_stack(t_psdata *data) int nb; ind = data->a; + if (ind) + nb = ind->nb; while (ind) { - nb = ind->nb; if (ind->nb < nb || data->size_b > 0) { ft_putendl("KO"); @@ -111,6 +112,8 @@ void check_stack(t_psdata *data) } if (!ind && data->size_b == 0) ft_putendl("OK"); + else + ft_putendl("KO"); } int main(int ac, char **av)