diff --git a/stack.c b/stack.c
index a2b1c5243607beb7486b8f7aed585d354c4a1c91..880491a63806064ccce414593ad895d3a3cb9708 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++;