From: Denis Ovsienko Date: Wed, 24 Nov 2021 15:08:00 +0000 (+0000) Subject: Use a sizeof() in bgp_rt_prefix_print(). [skip ci] X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/db78c36113d827104a787fb6ac018ce9c193c07b?hp=c72751f8cdc8bf0f87d26531d24d74aaddf377f2 Use a sizeof() in bgp_rt_prefix_print(). [skip ci] This way it is easier to see how the buffer is spent. --- diff --git a/print-bgp.c b/print-bgp.c index 0a09d9c2..cf06c837 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -915,7 +915,7 @@ bgp_rt_prefix_print(netdissect_options *ndo, u_int plen) { /* allocate space for the largest possible string */ - char rtc_prefix_in_hex[20] = ""; + char rtc_prefix_in_hex[sizeof("0000 0000 0000 0000")] = ""; u_int rtc_prefix_in_hex_len = 0; static char output[61]; /* max response string */ /* allocate space for the largest possible string */