summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-03-17 21:38:31 -0400
committerDavid Robillard <d@drobilla.net>2016-03-17 21:38:31 -0400
commit2843ab1de415ccaf9be291439ca04690c1ed073f (patch)
treeacfaeb4128caae51dd11482376a517bde434419c /src
parentce981fefe0c4d4f9c871b574a92eec06e3149e3e (diff)
downloadsord-2843ab1de415ccaf9be291439ca04690c1ed073f.tar.gz
sord-2843ab1de415ccaf9be291439ca04690c1ed073f.tar.bz2
sord-2843ab1de415ccaf9be291439ca04690c1ed073f.zip
Return NULL from sord_iter_get for end iterators
Diffstat (limited to 'src')
-rw-r--r--src/sord.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sord.c b/src/sord.c
index fbc33f7..22732c9 100644
--- a/src/sord.c
+++ b/src/sord.c
@@ -445,7 +445,9 @@ sord_iter_get(const SordIter* iter, SordQuad id)
const SordNode*
sord_iter_get_node(const SordIter* iter, SordQuadIndex index)
{
- return iter ? ((SordNode**)zix_btree_get(iter->cur))[index] : NULL;
+ return (!sord_iter_end(iter)
+ ? ((SordNode**)zix_btree_get(iter->cur))[index]
+ : NULL);
}
static bool