From 5af47adf6b02a4b260ed717944c40d6ed120577a Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 3 Dec 2012 13:57:28 -0800 Subject: [PATCH] Fix mdb_midl_shrink --- libraries/liblmdb/midl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/liblmdb/midl.c b/libraries/liblmdb/midl.c index 8de61e3d0c..7289f405d9 100644 --- a/libraries/liblmdb/midl.c +++ b/libraries/liblmdb/midl.c @@ -132,7 +132,7 @@ void mdb_midl_free(MDB_IDL ids) int mdb_midl_shrink( MDB_IDL *idp ) { MDB_IDL ids = *idp; - if (ids[-1] > MDB_IDL_UM_MAX) { + if (*(--ids) > MDB_IDL_UM_MAX) { ids = realloc(ids, (MDB_IDL_UM_MAX+1) * sizeof(MDB_ID)); *ids++ = MDB_IDL_UM_MAX; *idp = ids; -- 2.39.5