From: Anatoly Burakov Date: Tue, 17 Apr 2018 15:44:05 +0000 (+0100) Subject: fbarray: use strlcpy instead of snprintf X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9d3ba1e0ad248a6c2166277e7c7d6e25dc35c140;p=dpdk.git fbarray: use strlcpy instead of snprintf Signed-off-by: Anatoly Burakov Acked-by: Adrien Mazarguil --- diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c index 9d9d67d3f8..d8ebd621c4 100644 --- a/lib/librte_eal/common/eal_common_fbarray.c +++ b/lib/librte_eal/common/eal_common_fbarray.c @@ -471,7 +471,7 @@ rte_fbarray_init(struct rte_fbarray *arr, const char *name, unsigned int len, memset(data, 0, mmap_len); /* populate data structure */ - snprintf(arr->name, sizeof(arr->name), "%s", name); + strlcpy(arr->name, name, sizeof(arr->name)); arr->data = data; arr->len = len; arr->elt_sz = elt_sz;