nostrdb/cursor: fix empty string pushing in push_c_str
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
Daniel D’Aquino
parent
b5ad3ed1a5
commit
887eb4e1e2
@@ -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)
|
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);
|
return cursor_push_str(cursor, str) && cursor_push_byte(cursor, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user