ethdev: replace snprintf with strlcpy on init

Don't need to use snprintf for simple name copy.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
This commit is contained in:
Stephen Hemminger 2019-02-28 14:47:54 -08:00 committed by Ferruh Yigit
parent e97f83e452
commit ddf5a9c6d7

View File

@ -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;