aboutsummaryrefslogtreecommitdiff
path: root/stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'stack.c')
-rw-r--r--stack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stack.c b/stack.c
index f594775..162324e 100644
--- a/stack.c
+++ b/stack.c
@@ -47,10 +47,10 @@ stack_push(struct stack *stack, T data)
47bool 47bool
48stack_pop(struct stack *stack, T *data) 48stack_pop(struct stack *stack, T *data)
49{ 49{
50 if ( stack->head != NULL ) { 50 if ( stack->head ) {
51 struct stack_item *next = stack->head->next; 51 struct stack_item *next = stack->head->next;
52 52
53 if ( data != NULL ) { 53 if ( data ) {
54 *data = stack->head->data; 54 *data = stack->head->data;
55 } 55 }
56 free(stack->head); 56 free(stack->head);