freebsd-src/sbin/ping
Jose Luis Duran 8db2c5802a ping: Fix the spacing between the time stamp and cp/dp
When an echo reply packet is received, the data is compared with the
sent data.  When a wrong byte is detected the command displays a report
with the differences.

The first row (the first 8-bytes of data after the ICMP header) should
include the time stamp (if data is at least 8-bytes), this value is not
taken into consideration for the comparison.  The remaining rows
represent the data (padded pattern) received/sent, with each byte being
compared for differences.

Print the space before (not after), to add an extra space after cp:/dp:
for better readability when the first time stamp octet is not
zero-padded, and to remove trailing spaces in the output.

Before:
    cp:99  0  0  c  1  5  c  0␣
    	ab cd ab cd ab cd ab cd ab cd ab cd ab cd ab cd␣
    	...

After:
    cp: 99  0  0  c  1  5  c  0
    	 ab cd ab cd ab cd ab cd ab cd ab cd ab cd ab cd
    	 ...

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/863
Differential Revision:	https://reviews.freebsd.org/D39492
2023-10-11 13:48:28 -04:00
..
tests ping: Fix the spacing between the time stamp and cp/dp 2023-10-11 13:48:28 -04:00
main.c ping: Unify ping/ping6 statistics section 2023-10-11 13:48:28 -04:00
main.h ping: Unify ping/ping6 statistics section 2023-10-11 13:48:28 -04:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend.options Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ping.8 ping: The -C option is also supported for IPv6. 2023-09-19 10:47:11 +02:00
ping.c ping: Fix the spacing between the time stamp and cp/dp 2023-10-11 13:48:28 -04:00
ping.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
ping6.c ping: Unify ping/ping6 statistics section 2023-10-11 13:48:28 -04:00
ping6.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
utils.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
utils.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00