aboutsummaryrefslogtreecommitdiff
path: root/sf-pcap.c
diff options
context:
space:
mode:
authorDenis Ovsienko <denis@ovsienko.info>2018-07-27 09:41:20 +0100
committerDenis Ovsienko <denis@ovsienko.info>2018-07-27 09:43:11 +0100
commit72790d83d4d0280525f60b9dc010c82cc7bdb5c3 (patch)
treea927a0e96686909b591e16f5b8d788ce5324d8d6 /sf-pcap.c
parente7eb3c769d1dfe88e3a0d3ba714d5098ee091d8e (diff)
Address a -Wformat-truncation= compiler warning.
As far as Ubuntu 18.04 kernel headers go, _UTSNAME_RELEASE_LENGTH = = _UTSNAME_VERSION_LENGTH = _UTSNAME_MACHINE_LENGTH = _UTSNAME_LENGTH = = 65. char release[_UTSNAME_RELEASE_LENGTH] contains the kernel version and possibly some suffixes, e.g. "4.15.0-29-generic". For most cases 32 bytes should be enough. char version[_UTSNAME_VERSION_LENGTH] contains the kernel build number, name and date, e.g. "#31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018". This may actually take up to 64 characters. char machine[_UTSNAME_MACHINE_LENGTH] contains the hardware name, e.g. "x86_64". For most cases 16 bytes should be enough. ./pcap-linux.c: In function ‘pcap_handle_packet_mmap’: ./pcap-linux.c:5030:5: warning: ‘%s’ directive output may be truncated writing up to 64 bytes into a region of size between 9 and 160 [-Wformat-truncation=] "corrupted frame on kernel ring mac " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./pcap-linux.c:5035:5: utsname.machine); ~~~~~~~ ./pcap-linux.c:5032:37: note: format string is defined here "(kernel %s version %s, machine %s)", ^~
Diffstat (limited to 'sf-pcap.c')
0 files changed, 0 insertions, 0 deletions