]> git.sur5r.net Git - openldap/commitdiff
Tweak MDB_PREV_MULTIPLE for uninit'd cursor
authorHoward Chu <hyc@openldap.org>
Tue, 16 Feb 2016 23:34:27 +0000 (23:34 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 16 Feb 2016 23:38:43 +0000 (23:38 +0000)
libraries/liblmdb/mdb.c

index f5980807f627340e7174f5a33a3350b815ce7f50..a366b40245f6f83e70440abc460489280b87c6fa 100644 (file)
@@ -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);