From: Stephen Hemminger Date: Fri, 11 Jan 2019 20:35:14 +0000 (-0800) Subject: net/tap: use strlcpy for interface name X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1d7490bc7cc96fb601e542d2287e5398201bb0f1;p=dpdk.git net/tap: use strlcpy for interface name snprintf is not needed here, use strlcpy instead. Signed-off-by: Stephen Hemminger Acked-by Keith Wiles --- diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 0ec030bef6..1c00681ba0 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -148,7 +148,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive) */ ifr.ifr_flags = (pmd->type == ETH_TUNTAP_TYPE_TAP) ? IFF_TAP : IFF_TUN | IFF_POINTOPOINT; - snprintf(ifr.ifr_name, IFNAMSIZ, "%s", pmd->name); + strlcpy(ifr.ifr_name, pmd->name, IFNAMSIZ); TAP_LOG(DEBUG, "ifr_name '%s'", ifr.ifr_name);