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>
#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"
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)){