]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove newlines from dighost errors calls
authorYedaya Katsman <yedaya.ka@gmail.com>
Sun, 16 Jun 2024 20:10:28 +0000 (23:10 +0300)
committerMark Andrews <marka@isc.org>
Mon, 5 Aug 2024 02:43:06 +0000 (02:43 +0000)
Not all invocations had it, and this makes it more consistent with
dighost_warning. Also remove the conditional newline when not outputting
yaml

bin/dig/dig.c
bin/dig/dighost.c

index 61fcd61424ca2b7ad2f52e5cbc933321c4052c06..e9665c9e015f3511182247ce26fc642b3ee9b751 100644 (file)
@@ -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
index 1e2303a1af720275710aad66cc960a4f76776a28..001e3a46c84a56a8577ceb8f31db801f95fd8096 100644 (file)
@@ -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;