From: Bruce Richardson Date: Fri, 3 Jul 2020 10:23:29 +0000 (+0100) Subject: eal: remove unnecessary null-termination in plugin path X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=efa75d61d26fdc2d9be19ccd3b3bcd0df0310138;p=dpdk.git eal: remove unnecessary null-termination in plugin path Since strlcpy always null-terminates, and the buffer is zeroed before copy anyway, there is no need to explicitly zero the end of the character array, or to limit the bytes that strlcpy can write. Signed-off-by: Bruce Richardson --- diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 24b223ebfd..75e8839c3d 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -352,8 +352,7 @@ eal_plugin_add(const char *path) return -1; } memset(solib, 0, sizeof(*solib)); - strlcpy(solib->name, path, PATH_MAX-1); - solib->name[PATH_MAX-1] = 0; + strlcpy(solib->name, path, PATH_MAX); TAILQ_INSERT_TAIL(&solib_list, solib, next); return 0;