From: Stephen Hemminger Date: Thu, 28 Feb 2019 22:47:54 +0000 (-0800) Subject: ethdev: replace snprintf with strlcpy on init X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ddf5a9c6d7aa240b1b97a4735a2abc1afe3c57af;p=dpdk.git ethdev: replace snprintf with strlcpy on init Don't need to use snprintf for simple name copy. Signed-off-by: Stephen Hemminger Reviewed-by: Rami Rosen --- diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 95889ed206..3f2253643e 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -459,7 +459,7 @@ rte_eth_dev_allocate(const char *name) } eth_dev = eth_dev_get(port_id); - snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name); + strlcpy(eth_dev->data->name, name, sizeof(eth_dev->data->name)); eth_dev->data->port_id = port_id; eth_dev->data->mtu = ETHER_MTU;