diff options
Diffstat (limited to 'lib/librte_eal/common/eal_common_bus.c')
-rw-r--r-- | lib/librte_eal/common/eal_common_bus.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c index 3e022d51..0943851c 100644 --- a/lib/librte_eal/common/eal_common_bus.c +++ b/lib/librte_eal/common/eal_common_bus.c @@ -36,6 +36,7 @@ #include <rte_bus.h> #include <rte_debug.h> +#include <rte_string_fns.h> #include "eal_private.h" @@ -212,7 +213,7 @@ rte_bus_find_by_device_name(const char *str) char name[RTE_DEV_NAME_MAX_LEN]; char *c; - snprintf(name, sizeof(name), "%s", str); + strlcpy(name, str, sizeof(name)); c = strchr(name, ','); if (c != NULL) c[0] = '\0'; |