summaryrefslogtreecommitdiff
path: root/libraries/liblmdb/mdb.c
diff options
context:
space:
mode:
authorHoward Chu <hyc@openldap.org>2016-02-16 23:34:27 +0000
committerHoward Chu <hyc@openldap.org>2016-02-16 23:38:43 +0000
commit3f62b727ccf3424daca1cdc24bbf98c869f44699 (patch)
tree91496946b39821a89fdc455348101ad015848efc /libraries/liblmdb/mdb.c
parentd909ab2f36e079087047dd842210b37cec8b6a84 (diff)
downloadlmdb-3f62b727ccf3424daca1cdc24bbf98c869f44699.tar.gz
lmdb-3f62b727ccf3424daca1cdc24bbf98c869f44699.tar.bz2
lmdb-3f62b727ccf3424daca1cdc24bbf98c869f44699.zip
Tweak MDB_PREV_MULTIPLE for uninit'd cursor
Diffstat (limited to 'libraries/liblmdb/mdb.c')
-rw-r--r--libraries/liblmdb/mdb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c
index f598080..a366b40 100644
--- a/libraries/liblmdb/mdb.c
+++ b/libraries/liblmdb/mdb.c
@@ -1573,7 +1573,7 @@ mdb_strerror(int err)
* and the actual use of the message uses more than 4K of stack.
*/
#define MSGSIZE 1024
-#define PADSIZE 4096
+#define PADSIZE 4096
char buf[MSGSIZE+PADSIZE], *ptr = buf;
#endif
int i;
@@ -7007,8 +7007,10 @@ fetchm:
break;
}
if (!(mc->mc_flags & C_INITIALIZED))
- rc = mdb_cursor_first(mc, key, data);
- else {
+ rc = mdb_cursor_last(mc, key, data);
+ else
+ rc = MDB_SUCCESS;
+ if (rc == MDB_SUCCESS) {
MDB_cursor *mx = &mc->mc_xcursor->mx_cursor;
if (mx->mc_flags & C_INITIALIZED) {
rc = mdb_cursor_sibling(mx, 0);