aboutsummaryrefslogtreecommitdiff
path: root/stack.c
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2021-12-30 11:01:32 +0100
committerThomas Schmucker <ts@its1.de>2021-12-30 11:01:32 +0100
commit214f0923ba2981649f14ec3761662332df446d9d (patch)
treea400269f616ed53cf378b7ac77bf1f486113c796 /stack.c
parent5e696c74c9649b0e54133d46a3ae92e5ce0632fb (diff)
downloaddata-structures-214f0923ba2981649f14ec3761662332df446d9d.tar.gz
data-structures-214f0923ba2981649f14ec3761662332df446d9d.tar.bz2
data-structures-214f0923ba2981649f14ec3761662332df446d9d.zip
code cleanup
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);