From cac83986621b0b172bb309ea5ad2c1beafe17269 Mon Sep 17 00:00:00 2001 From: "richarda.tyarks" <richard-andre.tyarks@etu.hesge.ch> Date: Thu, 2 Dec 2021 21:58:00 +0100 Subject: [PATCH] capacity is never changed --- stack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stack.c b/stack.c index a2b1c52..880491a 100644 --- a/stack.c +++ b/stack.c @@ -17,9 +17,9 @@ void stack_destroy(stack *s) { void stack_push(stack *s, int value) { - if (s->top == s->capacity-1) + if (s->top == DEFAULT_CAPACITY-1) { - assert(s->data = realloc(s->capacity * 2 * sizeof(int))); + assert(s->data = realloc(DEFAULT_CAPACITY * 2 * sizeof(int))); } s->top++; -- GitLab