From 4ccf1d4e84ac98b68fe98b1ca25e32f59dd69c3e Mon Sep 17 00:00:00 2001 From: job Date: Thu, 25 Aug 2022 17:11:34 +0000 Subject: [PATCH] Fix newline in JSON filemode OK tb@ --- usr.sbin/rpki-client/filemode.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/usr.sbin/rpki-client/filemode.c b/usr.sbin/rpki-client/filemode.c index b921c350442..32121eec637 100644 --- a/usr.sbin/rpki-client/filemode.c +++ b/usr.sbin/rpki-client/filemode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filemode.c,v 1.9 2022/08/25 11:07:28 job Exp $ */ +/* $OpenBSD: filemode.c,v 1.10 2022/08/25 17:11:34 job Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -272,9 +272,7 @@ proc_parser_file(char *file, unsigned char *buf, size_t len) int is_ta = 0; if (num++ > 0) { - if (outformats & FORMAT_JSON) - printf("\n"); - else + if ((outformats & FORMAT_JSON) == 0) printf("--\n"); } @@ -420,7 +418,7 @@ proc_parser_file(char *file, unsigned char *buf, size_t len) } if (outformats & FORMAT_JSON) - printf("\"\n}"); + printf("\"\n}\n"); else printf("\n"); -- 2.20.1