nostril

A C cli tool for creating nostr events
git clone git://jb55.com/nostril
Log | Files | Refs | Submodules | README | LICENSE

commit 5345d74be7538e6da3f5fdaa6914966c4e3c7133
parent ac7daddaf619fd167dd8e761a911f6ea63cc805e
Author: William Casarin <jb55@jb55.com>
Date:   Thu,  4 Dec 2025 20:51:01 -0800

fix envelope

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mnostril.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/nostril.c b/nostril.c @@ -383,11 +383,13 @@ static int event_to_json(struct cursor *c, struct nostr_event *ev, int envelope) if (!cursor_push_byte(c, '"')) return 0; } + if (!cursor_push_str(c, "}")) return 0; + if (envelope) { - if (!cursor_push_str(c, "]")) return 0; + return cursor_push_c_str(c, "]"); + } else { + return cursor_push_byte(c, 0); } - - return cursor_push_c_str(c, "}"); } static int print_event(struct nostr_event *ev, int envelope,