damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit b2080a946ebf48954bdfc40a41a08037cc5313ad
parent 942e47a720825d4dd3195069903b6752a1ee388c
Author: William Casarin <jb55@jb55.com>
Date:   Thu,  4 Jan 2024 14:38:21 -0800

nostrdb/cursor: fix bug when pushing last element

Signed-off-by: William Casarin <jb55@jb55.com>

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

diff --git a/nostrdb/src/cursor.h b/nostrdb/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; }