projects
/
platform
/
upstream
/
lmdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6cb1166
)
more for mdb_cursor_count
author
Howard Chu
<hyc@symas.com>
Thu, 24 Jul 2014 11:13:55 +0000
(
04:13
-0700)
committer
Howard Chu
<hyc@symas.com>
Thu, 24 Jul 2014 11:13:55 +0000
(
04:13
-0700)
return MDB_NOTFOUND if the cursor is empty
libraries/liblmdb/mdb.c
patch
|
blob
|
history
diff --git
a/libraries/liblmdb/mdb.c
b/libraries/liblmdb/mdb.c
index
3e62b2e
..
84477c4
100644
(file)
--- a/
libraries/liblmdb/mdb.c
+++ b/
libraries/liblmdb/mdb.c
@@
-6962,6
+6962,9
@@
mdb_cursor_count(MDB_cursor *mc, size_t *countp)
if (!(mc->mc_flags & C_INITIALIZED))
return EINVAL;
+ if (!mc->mc_snum || (mc->mc_flags & C_EOF))
+ return MDB_NOTFOUND;
+
leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) {
*countp = 1;