diff options
author | Marco Varlese <marco.varlese@suse.com> | 2018-06-27 09:54:44 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-06-27 15:29:47 +0000 |
commit | 99d7a72cbcad959e805e8e8b5efb112e9def69c2 (patch) | |
tree | 1fac922965f751f13e6fcfddf8a1e93c768c6dfd /src/vnet | |
parent | c5ee4fd4aa1f873e5448df3395a178b44e3d55f8 (diff) |
gcc8 and Wstringop-truncation
gcc8 introduced a new warning (Wstringop-truncation) which in our case
is being treated as error.
Disabling the warning globally might introduce bugs related to string
truncation which are not desired by the developer (e.g. bug).
Instead, this patch disables the warning only for those occurences
which have been verified to be non-bugs but the desired behaviour as per
developer will.
Change-Id: I0f04ff6b4fad44061e80a65af633fd7e0148a0c5
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/devices/virtio/vhost-user.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vnet/devices/virtio/vhost-user.c b/src/vnet/devices/virtio/vhost-user.c index 92447765726..f6406d469b2 100644 --- a/src/vnet/devices/virtio/vhost-user.c +++ b/src/vnet/devices/virtio/vhost-user.c @@ -3188,8 +3188,8 @@ vhost_user_dump_ifs (vnet_main_t * vnm, vlib_main_t * vm, vuid->is_server = vui->unix_server_index != ~0; vuid->sock_errno = vui->sock_errno; strncpy ((char *) vuid->sock_filename, (char *) vui->sock_filename, - ARRAY_LEN (vuid->sock_filename) - 1); - + sizeof (vuid->sock_filename)); + vuid->sock_filename[ARRAY_LEN (vuid->sock_filename) - 1] = '\0'; s = format (s, "%v%c", hi->name, 0); strncpy ((char *) vuid->if_name, (char *) s, |