nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

commit 82c94b40a34d5a29785b17a30e2e6afcdfdb2dd5
parent 321d188230b02b23576ef92ebe73cfcd4ac3431f
Author: William Casarin <jb55@jb55.com>
Date:   Thu,  4 Jan 2024 14:38:21 -0800

cursor: fix bug when pushing last element

Diffstat:
Msrc/cursor.h | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cursor.h b/src/cursor.h @@ -262,7 +262,7 @@ static inline int cursor_pop(struct cursor *cur, unsigned char *data, int len) static inline int cursor_push(struct cursor *cursor, unsigned char *data, int len) { - if (unlikely(cursor->p + len >= cursor->end)) { + if (unlikely(cursor->p + len > cursor->end)) { return 0; }