summaryrefslogtreecommitdiff
path: root/drivers/net/softnic
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2019-04-03 15:45:04 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-04-04 22:45:54 +0200
commitf9acaf84e923066344bd3467e4703da66f1f23a8 (patch)
treecd3780dd1ae1739aee8930533401e58d67b3f32e /drivers/net/softnic
parent277b6e7ef457729b88fe415dfd4a2184e5b329fb (diff)
downloaddpdk-f9acaf84e923066344bd3467e4703da66f1f23a8.zip
dpdk-f9acaf84e923066344bd3467e4703da66f1f23a8.tar.gz
dpdk-f9acaf84e923066344bd3467e4703da66f1f23a8.tar.xz
replace snprintf with strlcpy without adding extra include
For files that already have rte_string_fns.h included in them, we can do a straight replacement of snprintf(..."%s",...) with strlcpy. The changes in this patch were auto-generated via command: spatch --sp-file devtools/cocci/strlcpy-with-header.cocci --dir . --in-place Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'drivers/net/softnic')
-rw-r--r--drivers/net/softnic/rte_eth_softnic_tap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/softnic/rte_eth_softnic_tap.c b/drivers/net/softnic/rte_eth_softnic_tap.c
index 0cac876..36fe9f0 100644
--- a/drivers/net/softnic/rte_eth_softnic_tap.c
+++ b/drivers/net/softnic/rte_eth_softnic_tap.c
@@ -91,7 +91,7 @@ softnic_tap_create(struct pmd_internals *p,
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP | IFF_NO_PI; /* No packet information */
- snprintf(ifr.ifr_name, IFNAMSIZ, "%s", name);
+ strlcpy(ifr.ifr_name, name, IFNAMSIZ);
status = ioctl(fd, TUNSETIFF, (void *)&ifr);
if (status < 0) {