diff --git a/stack.c b/stack.c
index d72f8652136f5daf267203a011ea4c4ab250995a..a483a6e860208330d5085acee160ab437bebab87 100644
--- a/stack.c
+++ b/stack.c
@@ -24,7 +24,7 @@ void stack_push(stack *s, int value)
     }
     
     s->top++;
-    s->data[s->top] = val;
+    s->data[s->top] = value;
 }
 
 void stack_pop(stack *s, int *value) {