diff options
author | 2019-01-16 10:23:16 -0800 | |
---|---|---|
committer | 2019-01-17 09:19:33 +0000 | |
commit | 4e8a83183e9a381d6c44fa3b94faf735d536e811 (patch) | |
tree | 4294a6c241a18c6c7aef5724bd686143ee837766 /src/vlib/format.c | |
parent | ef080e1f9bad884b95ef23307b0d856c971dfcc2 (diff) |
pci: fix strncpy warnings
Doing strncpy(ifr.ifr_name, s, sizeof(ifr.ifr_name)) will cause
a warning about string truncation with GCC 8 (and other tools).
Fix this by using sizeof(ifr.ifr_name) - 1. Also, there is no
need to manually zero the end of the string since the whole
ifr structure is already zeroed by memset.
Change-Id: I9440d602ecdd9f8592b69bab2e77479146d00d76
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'src/vlib/format.c')
0 files changed, 0 insertions, 0 deletions