diff options
author | David Robillard <d@drobilla.net> | 2016-03-17 21:38:31 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-03-17 21:38:31 -0400 |
commit | 2843ab1de415ccaf9be291439ca04690c1ed073f (patch) | |
tree | acfaeb4128caae51dd11482376a517bde434419c /src | |
parent | ce981fefe0c4d4f9c871b574a92eec06e3149e3e (diff) | |
download | sord-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |