From 33cbe45795557da6a1cb8921c03bc5213e15b005 Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Sat, 13 Apr 2024 14:39:57 +0200 Subject: Finish command handling and add command printing --- stack_utils.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'stack_utils.c') diff --git a/stack_utils.c b/stack_utils.c index 7a22b47..ad14504 100644 --- a/stack_utils.c +++ b/stack_utils.c @@ -6,11 +6,10 @@ /* By: dkaiser next->next) - *stack = (*stack)->next; - (*stack)->next->next = first_elem; - (*stack)->next = NULL; + first_elem = *stack; + while ((*stack)->next->next) + *stack = (*stack)->next; + (*stack)->next->next = first_elem; + (*stack)->next = NULL; } -- cgit v1.2.3