From 8c5789367526773af754311fdbe19b48c8e9cca6 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 8 May 2020 05:28:52 -0700 Subject: [PATCH] ETHER: Avoid potential compiler warning about version string overrun gcc 9.3.0 on Ubuntu 20.04 somehow knows that the length of the string pcap_lib_version() returns can be 256 bytes long. It then generates a warning about truncation potential. The problematic code path will only be executed on Windows with an old version of Npcap, but the compiler can't know that. Make the local buffer larger to silence the resulting noise. --- sim_ether.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim_ether.c b/sim_ether.c index f85fc072..920714d6 100644 --- a/sim_ether.c +++ b/sim_ether.c @@ -2475,7 +2475,7 @@ return SCPE_OK; const char *eth_version (void) { #if defined(HAVE_PCAP_NETWORK) -static char version[256]; +static char version[300]; if (!version[0]) { strlcpy(version, pcap_lib_version(), sizeof(version));