diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 513706d..4b79e15 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4938,8 +4938,8 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data, if (rc > 0) { rc = MDB_NOTFOUND; mc->mc_ki[mc->mc_top]++; - } else { - /* new key is <= last key */ + } else if (rc < 0) { + /* new key is < last key */ rc = MDB_KEYEXIST; } }