]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ping: fix -Wformat-truncating warning with GCC
authorasomers <asomers@FreeBSD.org>
Mon, 19 Aug 2019 17:28:12 +0000 (17:28 +0000)
committerasomers <asomers@FreeBSD.org>
Mon, 19 Aug 2019 17:28:12 +0000 (17:28 +0000)
commitbd1a23c8ea25b922287643ef945139b9d7ece308
tree6ac433225debe6744349e59232c53efdd0d32c6b
parentedecb5a3c5b15198cd606ee0afae801fc96e495b
ping: fix -Wformat-truncating warning with GCC

Increase buffer size for the string representation of n_time

ICMP timestamp is a 32-bit number. In pr_ntime(), number of minutes
and seconds is always 2 characters wide. Max. number of hours is 4
characters wide. The buffer size should be at least:

4 + 2 + 2 + 1 (':') + 1 (':') + 1 ('\0') = 11

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21325
sbin/ping/ping.c