]> The Tcpdump Group git mirrors - tcpdump/commit
BGP: Address a -Wformat-truncation= compiler warning
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 27 May 2020 15:28:27 +0000 (17:28 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 27 May 2020 16:37:14 +0000 (18:37 +0200)
commit2758724645678af41b6c4f59361ea063a2b89a44
tree3cf9ceba79674e1951871bb3db05b1417c306357
parent4243f5c5d61f98e4bb09cc452a5b5dd3d34f1b27
BGP: Address a -Wformat-truncation= compiler warning

The warning was:
./print-bgp.c:973:79: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
  973 |         snprintf(output, sizeof(output), "route-target: %u.%u.%u.%u:%u/%d (%s)",
      |                                                                               ^
./print-bgp.c:973:9: note: 'snprintf' output between 30 and 61 bytes into a destination of size 60
  973 |         snprintf(output, sizeof(output), "route-target: %u.%u.%u.%u:%u/%d (%s)",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  974 |                  *(pptr+2), *(pptr+3), *(pptr+4), *(pptr+5),
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  975 |                  EXTRACT_BE_U_2(pptr+6), plen, rtc_prefix_in_hex);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
print-bgp.c