From e2587277392a86b5bd26854ae3118f3306cf81bb Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Sun, 16 Jun 2024 23:10:28 +0300 Subject: [PATCH] Remove newlines from dighost errors calls Not all invocations had it, and this makes it more consistent with dighost_warning. Also remove the conditional newline when not outputting yaml (cherry picked from commit 1dd76fe78051b926f2f7b614a40af550c6c6cdf2) --- bin/dig/dig.c | 5 +---- bin/dig/dighost.c | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 61fcd61424..e9665c9e01 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -3322,10 +3322,7 @@ dig_error(const char *format, ...) { va_start(args, format); vprintf(format, args); va_end(args); - - if (!yaml) { - printf("\n"); - } + printf("\n"); /* We get the error without a newline */ } static void diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 1e2303a1af..001e3a46c8 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -3231,7 +3231,7 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) { start_udp(next); check_if_done(); } else { - dighost_error("no servers could be reached\n"); + dighost_error("no servers could be reached"); clear_current_lookup(); } @@ -3423,10 +3423,10 @@ force_next(dig_query_t *query) { isc_netaddr_fromsockaddr(&netaddr, &query->sockaddr); isc_netaddr_format(&netaddr, buf, sizeof(buf)); - dighost_error("no response from %s\n", buf); + dighost_error("no response from %s", buf); } else { printf("%s", l->cmdline); - dighost_error("no servers could be reached\n"); + dighost_error("no servers could be reached"); } if (exitcode < 9) { @@ -3650,7 +3650,7 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) { start_tcp(next); check_if_done(); } else { - dighost_error("no servers could be reached\n"); + dighost_error("no servers could be reached"); clear_current_lookup(); } @@ -4103,7 +4103,7 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region, * and cancel the lookup. */ printf("%s", l->cmdline); - dighost_error("no servers could be reached\n"); + dighost_error("no servers could be reached"); if (exitcode < 9) { exitcode = 9;