summaryrefslogtreecommitdiff
path: root/drivers/net/mvneta/mvneta_ethdev.c
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2019-04-03 15:45:05 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-04-04 22:46:05 +0200
commit6723c0fc7207ca4416822b170b1485a78aa47c7c (patch)
treefef3c6683019dcdf1403761e047308af49f49f8f /drivers/net/mvneta/mvneta_ethdev.c
parentf9acaf84e923066344bd3467e4703da66f1f23a8 (diff)
downloaddpdk-6723c0fc7207ca4416822b170b1485a78aa47c7c.zip
dpdk-6723c0fc7207ca4416822b170b1485a78aa47c7c.tar.gz
dpdk-6723c0fc7207ca4416822b170b1485a78aa47c7c.tar.xz
replace snprintf with strlcpy
Do a global replace of snprintf(..."%s",...) with strlcpy, adding in the rte_string_fns.h header if needed. The function changes in this patch were auto-generated via command: spatch --sp-file devtools/cocci/strlcpy.cocci --dir . --in-place and then the files edited using awk to add in the missing header: gawk -i inplace '/include <rte_/ && ! seen { \ print "#include <rte_string_fns.h>"; seen=1} {print}' Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'drivers/net/mvneta/mvneta_ethdev.c')
-rw-r--r--drivers/net/mvneta/mvneta_ethdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index 2d76664..8923a16 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -4,6 +4,7 @@
* All rights reserved.
*/
+#include <rte_string_fns.h>
#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_bus_vdev.h>
@@ -347,7 +348,7 @@ mvneta_dev_start(struct rte_eth_dev *dev)
if (priv->ppio)
return mvneta_dev_set_link_up(dev);
- snprintf(match, sizeof(match), "%s", dev->data->name);
+ strlcpy(match, dev->data->name, sizeof(match));
priv->ppio_params.match = match;
priv->ppio_params.inqs_params.mtu = dev->data->mtu;