From 6aaecbc7b31e297ce07e75a268ee201ec7cbd0e5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 8 Jul 2021 14:57:38 +0930 Subject: [PATCH] plugins/offers: fix crash when we report unpaid prev invoice. And add annotation so compiler spots it! Signed-off-by: Rusty Russell --- plugins/offers_invreq_hook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/offers_invreq_hook.c b/plugins/offers_invreq_hook.c index 26987478b..843738cad 100644 --- a/plugins/offers_invreq_hook.c +++ b/plugins/offers_invreq_hook.c @@ -65,7 +65,7 @@ fail_invreq_level(struct command *cmd, "invoice_error", errdata); } -static struct command_result *WARN_UNUSED_RESULT +static struct command_result *WARN_UNUSED_RESULT PRINTF_FMT(3,4) fail_invreq(struct command *cmd, const struct invreq *invreq, const char *fmt, ...) @@ -361,7 +361,7 @@ static struct command_result *prev_invoice_done(struct command *cmd, status = json_get_member(buf, arr + 1, "status"); if (!json_tok_streq(buf, status, "paid")) { return fail_invreq(cmd, ir, - "Previous invoice #%u status *.%s", + "Previous invoice #%u status %.*s", *ir->inv->recurrence_counter - 1, json_tok_full_len(status), json_tok_full(buf, status));