From: Hallvard Furuseth Date: Sat, 10 Sep 2011 08:11:55 +0000 (+0200) Subject: explain mdl_midl_sort() istack size X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~148^2~42^2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5f682934751d54263df19f3b181f1555158daf25;p=openldap explain mdl_midl_sort() istack size --- diff --git a/libraries/libmdb/midl.c b/libraries/libmdb/midl.c index 2aee4311ea..7a7b59c7c0 100644 --- a/libraries/libmdb/midl.c +++ b/libraries/libmdb/midl.c @@ -15,6 +15,7 @@ * . */ +#include #include #include #include @@ -134,7 +135,8 @@ int mdb_midl_append( IDL ids, ID id ) void mdb_midl_sort( ID *ids ) { - int istack[16*sizeof(int)]; + /* Max possible depth of int-indexed tree * 2 items/level */ + int istack[sizeof(int)*CHAR_BIT * 2]; int i,j,k,l,ir,jstack; ID a, itmp;