diff options
Diffstat (limited to 'src/position_stack.c')
-rw-r--r-- | src/position_stack.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/position_stack.c b/src/position_stack.c index 3d546b8..90ace87 100644 --- a/src/position_stack.c +++ b/src/position_stack.c @@ -23,7 +23,7 @@ struct PositionStack *create_pos_stack(int capacity) { struct PositionStack *stack_pt = malloc(sizeof(struct PositionStack)); - stack_pt->max_size = capacity; + stack_pt->capacity = capacity; stack_pt->top = -1; stack_pt->items = malloc(sizeof(struct Position) * capacity); @@ -34,7 +34,7 @@ struct PositionStack *create_pos_stack(int capacity) void pos_stack_push(struct PositionStack *stack_pt, struct Position pos) { // Avoid a overflow by checking if the stack is full - if (stack_pt->top == stack_pt->max_size - 1) + if (stack_pt->top == stack_pt->capacity - 1) { stack_error(STACK_ERR_OVERFLOW); } @@ -66,4 +66,4 @@ struct Position pos_stack_pop(struct PositionStack *stack_pt) // Decrease the stack size by 1 and return the popped element return stack_pt->items[stack_pt->top--]; -}
\ No newline at end of file +} |