From 414608ff2511a18d9488d606ef7d7cd7ef7119d9 Mon Sep 17 00:00:00 2001 From: Lowly Worm Date: Tue, 6 Jun 2017 00:27:50 -0400 Subject: [PATCH] use the is_empty api call for peek --- libr/util/stack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libr/util/stack.c b/libr/util/stack.c index 62766cea8c..2f16a78e06 100644 --- a/libr/util/stack.c +++ b/libr/util/stack.c @@ -74,7 +74,7 @@ R_API unsigned int r_stack_size(RStack *s) { R_API void *r_stack_peek(RStack *s) { void *res; - if (s->top != -1) { + if (!r_stack_is_empty (s)) { res = s->elems[s->top]; return res; }