nostrdb/cursor: fix bug when pushing last element

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-01-04 14:38:21 -08:00
committed by Daniel D’Aquino
parent 942e47a720
commit b2080a946e

View File

@@ -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;
}