summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/lmdb/midl.c
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-02-14 20:39:28 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-02-14 20:39:28 +0000
commita7967e3364a0b5528433de65cfbb743c57625e72 (patch)
treebddcecc1f9777831ab6d43ad9797ec14502adc43 /plugins/Dbx_mdb/src/lmdb/midl.c
parent817ab540b6a95a77deea5a8368503a8d1a3eb449 (diff)
reverted last commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@16281 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/lmdb/midl.c')
-rw-r--r--plugins/Dbx_mdb/src/lmdb/midl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/Dbx_mdb/src/lmdb/midl.c b/plugins/Dbx_mdb/src/lmdb/midl.c
index 5c6d841a7a..88a3aff10c 100644
--- a/plugins/Dbx_mdb/src/lmdb/midl.c
+++ b/plugins/Dbx_mdb/src/lmdb/midl.c
@@ -3,7 +3,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2000-2015 The OpenLDAP Foundation.
+ * Copyright 2000-2014 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -116,15 +116,17 @@ void mdb_midl_free(MDB_IDL ids)
free(ids-1);
}
-void mdb_midl_shrink( MDB_IDL *idp )
+int mdb_midl_shrink( MDB_IDL *idp )
{
MDB_IDL ids = *idp;
if (*(--ids) > MDB_IDL_UM_MAX &&
- (ids = realloc(ids, (MDB_IDL_UM_MAX+2) * sizeof(MDB_ID))))
+ (ids = realloc(ids, (MDB_IDL_UM_MAX+1) * sizeof(MDB_ID))))
{
*ids++ = MDB_IDL_UM_MAX;
*idp = ids;
+ return 1;
}
+ return 0;
}
static int mdb_midl_grow( MDB_IDL *idp, int num )