summaryrefslogtreecommitdiff
path: root/drivers/net/failsafe
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/failsafe
parent5364de644a4ba99497edbed05bff942b2b461413 (diff)
downloaddpdk-next-eventdev-c022cb400e920624dd10e162ef12917b3039b846.zip
dpdk-next-eventdev-c022cb400e920624dd10e162ef12917b3039b846.tar.gz
dpdk-next-eventdev-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/failsafe')
-rw-r--r--drivers/net/failsafe/failsafe_args.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/failsafe/failsafe_args.c b/drivers/net/failsafe/failsafe_args.c
index 366dbea..ea934f9 100644
--- a/drivers/net/failsafe/failsafe_args.c
+++ b/drivers/net/failsafe/failsafe_args.c
@@ -14,6 +14,7 @@
#include <rte_devargs.h>
#include <rte_malloc.h>
#include <rte_kvargs.h>
+#include <rte_string_fns.h>
#include "failsafe_private.h"
@@ -340,7 +341,7 @@ fs_remove_sub_devices_definition(char params[DEVARGS_MAXLEN])
a = b + 1;
}
out:
- snprintf(params, DEVARGS_MAXLEN, "%s", buffer);
+ strlcpy(params, buffer, DEVARGS_MAXLEN);
return 0;
}
@@ -392,7 +393,7 @@ failsafe_args_parse(struct rte_eth_dev *dev, const char *params)
ret = 0;
priv->subs_tx = FAILSAFE_MAX_ETHPORTS;
/* default parameters */
- n = snprintf(mut_params, sizeof(mut_params), "%s", params);
+ n = strlcpy(mut_params, params, sizeof(mut_params));
if (n >= sizeof(mut_params)) {
ERROR("Parameter string too long (>=%zu)",
sizeof(mut_params));