immer noch ohne clearstak

This commit is contained in:
Max-R 2025-12-05 11:47:36 +01:00
parent 09426ae40a
commit 0575eac07e
5 changed files with 6 additions and 4 deletions

Binary file not shown.

View File

@ -65,11 +65,12 @@ void clearStack(StackNode *stack)
while (stack != NULL)
{
StackNode *next = stack->next;
StackNode *next = (stack)->next;
free(stack);
stack = next;
stack->data = NULL;
stack->next = NULL;
stack->prev = NULL;
(stack)->data = NULL;
(stack)->next = NULL;
(stack)->prev = NULL;
}
}

BIN
stack.o

Binary file not shown.

View File

@ -35,6 +35,7 @@ void test_clearStack(void) {
testStack = push(testStack, &testInts[i]);
}
//printf("testints: %d,%d,%d,%d,%d",testInts[0],testInts[1],testInts[2],testInts[3],testInts[4]);
clearStack(testStack);
TEST_ASSERT_NULL(testStack);

Binary file not shown.