summaryrefslogtreecommitdiff
path: root/drivers/bus/ifpga
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2018-05-12 08:02:17 +0100
committerThomas Monjalon <thomas@monjalon.net>2018-05-13 12:06:01 +0200
commit4c80789430d617d7ed3159d80041919fdddb6cd7 (patch)
treeabdb6030ee74eaee1de44b1f61b0724ba6b7feda /drivers/bus/ifpga
parent775a57eff2079cbf3cac1c8832067b8b281aa05b (diff)
downloaddpdk-4c80789430d617d7ed3159d80041919fdddb6cd7.zip
dpdk-4c80789430d617d7ed3159d80041919fdddb6cd7.tar.gz
dpdk-4c80789430d617d7ed3159d80041919fdddb6cd7.tar.xz
bus/fpga: use strlcpy instead of strncpy
Gcc 8 reports a build error: drivers/bus/ifpga/ifpga_bus.c:161:2: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation] strncpy(afu_pr_conf.bs_path, path, sizeof(afu_pr_conf.bs_path)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Diffstat (limited to 'drivers/bus/ifpga')
-rw-r--r--drivers/bus/ifpga/ifpga_bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index 16b7e06..45597a1 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -20,10 +20,10 @@
#include <rte_memzone.h>
#include <rte_eal.h>
#include <rte_common.h>
-
#include <rte_devargs.h>
#include <rte_kvargs.h>
#include <rte_alarm.h>
+#include <rte_string_fns.h>
#include "rte_rawdev.h"
#include "rte_rawdev_pmd.h"
@@ -158,7 +158,7 @@ ifpga_scan_one(struct rte_rawdev *rawdev,
rawdev->dev_ops->dev_start(rawdev))
goto free_dev;
- strncpy(afu_pr_conf.bs_path, path, sizeof(afu_pr_conf.bs_path));
+ strlcpy(afu_pr_conf.bs_path, path, sizeof(afu_pr_conf.bs_path));
if (rawdev->dev_ops->firmware_load &&
rawdev->dev_ops->firmware_load(rawdev,
&afu_pr_conf)){