mbuf: fix truncated strncpy
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 29 Mar 2018 17:05:30 +0000 (10:05 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 4 Apr 2018 15:34:20 +0000 (17:34 +0200)
commit8ea081f381615308bb872a608ebbdb0aa6c9f90f
treedb7795c57250f1818ee528cb220ab0555c1c14b8
parent255d42d5b612e9a88beee1576ea5bb33f0a74f57
mbuf: fix truncated strncpy

Gcc-8 discovers issue with platform_mempool_ops.
rte_mbuf_pool_ops.c:26:3: error: ‘strncpy’ output truncated before
  terminating nul copying as many bytes from a string as its length
  [-Werror=stringop-truncation]
  strncpy(mz->addr, ops_name,  strlen(ops_name));

Since the ops_name is already checked for size, using strncpy
here is unnecessary; just use strcpy.

Fixes: a3acc3144a76 ("mbuf: add pool ops selection functions")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/librte_mbuf/rte_mbuf_pool_ops.c