nostrdb/cursor: fix empty string pushing in push_c_str

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2023-12-27 12:41:19 -08:00
committed by Daniel D’Aquino
parent b5ad3ed1a5
commit 887eb4e1e2

View File

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