From b2080a946ebf48954bdfc40a41a08037cc5313ad Mon Sep 17 00:00:00 2001 From: William Casarin Date: Thu, 4 Jan 2024 14:38:21 -0800 Subject: [PATCH] nostrdb/cursor: fix bug when pushing last element Signed-off-by: William Casarin --- nostrdb/src/cursor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nostrdb/src/cursor.h b/nostrdb/src/cursor.h index 6d4bbf97..21301c73 100644 --- 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; }