git: b0da2a3fa145 - stable/14 - ping: Remove an extra new line character

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 06 Nov 2023 16:45:51 UTC
The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=b0da2a3fa1458b5cf404edc868b3014bd8825ed7

commit b0da2a3fa1458b5cf404edc868b3014bd8825ed7
Author:     Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2023-02-09 18:16:39 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-11-06 16:45:43 +0000

    ping: Remove an extra new line character
    
    This matches the behavior when an RR truncated route is printed.
    
    Reviewed by:    markj
    MFC after:      1 week
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/863
    Differential Revision:  https://reviews.freebsd.org/D39485
    
    (cherry picked from commit d2c9a140547acf1bfe3a233ef15cf971be93e14d)
---
 sbin/ping/ping.c             | 2 +-
 sbin/ping/tests/test_ping.py | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index f67d85f30a5d..848ffbbb7c76 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1406,7 +1406,7 @@ pr_pack(char *buf, ssize_t cc, struct sockaddr_in *from, struct timespec *tv)
 					(void)putchar('\n');
 				}
 			} else
-				(void)printf("\t(truncated route)\n");
+				(void)printf("\t(truncated route)");
 			break;
 		case IPOPT_RR:
 			j = cp[IPOPT_OLEN];		/* get length */
diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
index 93d45a1e3d7b..8d3bd115e2a6 100644
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -859,7 +859,6 @@ PING 192.0.2.2 (192.0.2.2): 56 data bytes
 64 bytes from: icmp_seq=0 ttl= time= ms
 LSRR: 	(truncated route)
 
-
 --- 192.0.2.2 ping statistics ---
 1 packets transmitted, 1 packets received, 0.0% packet loss
 round-trip min/avg/max/stddev = /// ms
@@ -916,7 +915,6 @@ PING 192.0.2.2 (192.0.2.2): 56 data bytes
 64 bytes from: icmp_seq=0 ttl= time= ms
 SSRR: 	(truncated route)
 
-
 --- 192.0.2.2 ping statistics ---
 1 packets transmitted, 1 packets received, 0.0% packet loss
 round-trip min/avg/max/stddev = /// ms