From 803d749d862f5dfbf1c34e443afb6f279e1d6a48 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 16 Feb 2022 06:31:13 -0500 Subject: [PATCH] Use printbuf_indent_push This properly indents multi-line printbuf output Signed-off-by: Kent Overstreet --- cmd_debug.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd_debug.c b/cmd_debug.c index 71e729c3..6ff58a96 100644 --- a/cmd_debug.c +++ b/cmd_debug.c @@ -606,10 +606,12 @@ int cmd_list_journal(int argc, char *argv[]) le64_to_cpu(p->j.last_seq)); vstruct_for_each(&p->j, entry) { - char buf[500]; + char _buf[4096]; + struct printbuf buf = PBUF(_buf); - bch2_journal_entry_to_text(&PBUF(buf), c, entry); - printf(" %s\n", buf); + printbuf_indent_push(&buf, 2); + bch2_journal_entry_to_text(&buf, c, entry); + printf("%s\n", _buf); } }