summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2013-09-22 16:17:46 +0000
committerXuefer <xuefer@gmail.com>2013-09-22 16:17:46 +0000
commite715a9197818cad6d6fc679263751e0cf759967b (patch)
tree44cf5c8b19b07332959430c7a9729153634b6c33 /util
parentf46ace6822589c8e68120ccddc8d9ccfec5a92c6 (diff)
downloadxcache-e715a9197818cad6d6fc679263751e0cf759967b.tar.gz
xcache-e715a9197818cad6d6fc679263751e0cf759967b.zip
readonly protection for copied array
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1385 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'util')
-rw-r--r--util/xc_stack.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/util/xc_stack.c b/util/xc_stack.c
index 7407583..25be04c 100644
--- a/util/xc_stack.c
+++ b/util/xc_stack.c
@@ -27,19 +27,22 @@ void xc_stack_push(S stack, void *item)
void* xc_stack_pop(S stack)
{
- assert(stack != NULL && stack->size > 0);
+ assert(stack != NULL);
+ assert(stack->size > 0);
return stack->data[--stack->cnt];
}
void* xc_stack_top(S stack)
{
- assert(stack != NULL && stack->cnt > 0);
+ assert(stack != NULL);
+ assert(stack->cnt > 0);
return stack->data[stack->cnt-1];
}
void* xc_stack_get(S stack, int n)
{
- assert(stack != NULL && stack->cnt > 0);
+ assert(stack != NULL);
+ assert(stack->cnt > 0);
return stack->data[n];
}