summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_ethdev.c
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2018-03-12 11:33:00 +0000
committerThomas Monjalon <thomas@monjalon.net>2018-04-04 17:33:08 +0200
commitc022cb400e920624dd10e162ef12917b3039b846 (patch)
treec4c92b3ded4f9f0408aad7e606c22fd8226c93d8 /drivers/net/mlx5/mlx5_ethdev.c
parent5364de644a4ba99497edbed05bff942b2b461413 (diff)
downloaddpdk-c022cb400e920624dd10e162ef12917b3039b846.zip
dpdk-c022cb400e920624dd10e162ef12917b3039b846.tar.gz
dpdk-c022cb400e920624dd10e162ef12917b3039b846.tar.xz
convert snprintf to strlcpy
Since we have support for the strlcpy function in DPDK, replace all instances where a string is copied using snprintf. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'drivers/net/mlx5/mlx5_ethdev.c')
-rw-r--r--drivers/net/mlx5/mlx5_ethdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index b6f5101..cc85f76 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -33,6 +33,7 @@
#include <rte_common.h>
#include <rte_interrupts.h>
#include <rte_malloc.h>
+#include <rte_string_fns.h>
#include "mlx5.h"
#include "mlx5_glue.h"
@@ -165,7 +166,7 @@ try_dev_id:
goto try_dev_id;
dev_port_prev = dev_port;
if (dev_port == (priv->port - 1u))
- snprintf(match, sizeof(match), "%s", name);
+ strlcpy(match, name, sizeof(match));
}
closedir(dir);
if (match[0] == '\0') {