diff options
author | Marvin Borner | 2021-01-21 14:40:20 +0100 |
---|---|---|
committer | Marvin Borner | 2021-01-21 14:40:20 +0100 |
commit | 7442dc40a12bd61d6a77fafbc1ea031a2b51937a (patch) | |
tree | da42e944ce1865c6483df14b04e55129af0d7b3a /libc | |
parent | 64ccbef99bdadc816e8c756ca8b5ae9a148a47fd (diff) |
Fixed stray keyboard characters
Diffstat (limited to 'libc')
-rw-r--r-- | libc/inc/stack.h | 1 | ||||
-rw-r--r-- | libc/stack.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libc/inc/stack.h b/libc/inc/stack.h index 8fec25f..16725f8 100644 --- a/libc/inc/stack.h +++ b/libc/inc/stack.h @@ -23,5 +23,6 @@ u32 stack_push_bot(struct stack *stack, void *data); u32 stack_push(struct stack *stack, void *data); void *stack_pop(struct stack *stack); void *stack_peek(struct stack *stack); +void stack_clear(struct stack *stack); #endif diff --git a/libc/stack.c b/libc/stack.c index dac18a2..c47dd59 100644 --- a/libc/stack.c +++ b/libc/stack.c @@ -117,3 +117,9 @@ void *stack_peek(struct stack *stack) return stack->tail; } + +void stack_clear(struct stack *stack) +{ + while (stack_pop(stack)) + ; +} |