commit 887eb4e1e2148026d43cb2f66570d80aa14d0eb0
parent b5ad3ed1a5697d78d19936f4008f1cdc333c29a2
Author: William Casarin <jb55@jb55.com>
Date: Wed, 27 Dec 2023 12:41:19 -0800
nostrdb/cursor: fix empty string pushing in push_c_str
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/nostrdb/src/cursor.h b/nostrdb/src/cursor.h
@@ -398,6 +398,8 @@ static inline int cursor_push_str(struct cursor *cursor, const char *str)
static inline int cursor_push_c_str(struct cursor *cursor, const char *str)
{
+ if (str == NULL)
+ return cursor_push_byte(cursor, 0);
return cursor_push_str(cursor, str) && cursor_push_byte(cursor, 0);
}