fbarray: use strlcpy instead of snprintf
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 17 Apr 2018 15:44:05 +0000 (16:44 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 23 Apr 2018 20:44:20 +0000 (22:44 +0200)
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
lib/librte_eal/common/eal_common_fbarray.c

index 9d9d67d..d8ebd62 100644 (file)
@@ -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;