fix off-by-one errors in snprintf
authorMichael Santana <msantana@redhat.com>
Fri, 10 May 2019 14:53:12 +0000 (10:53 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 29 May 2019 11:02:53 +0000 (13:02 +0200)
commitf4be6a9a2903e68f5f04124eeb59325c17f1e1eb
tree697aa867138ca13ddae4c7d7a37345d023c487ab
parentd31b95860d8e9dd7c6e242bd08baaac00a9714f0
fix off-by-one errors in snprintf

snprintf guarantees to always correctly place a null terminator
in the buffer string. So manually placing a null terminator
in a buffer right after a call to snprintf is redundant code.

Additionally, there is no need to use 'sizeof(buffer) - 1' in snprintf as this
means we are not using the last character in the buffer. 'sizeof(buffer)' is
enough.

Cc: stable@dpdk.org
Signed-off-by: Michael Santana <msantana@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
drivers/net/qede/base/bcm_osal.c
drivers/net/qede/qede_filter.c
drivers/net/vdev_netvsc/vdev_netvsc.c
examples/multi_process/client_server_mp/shared/common.h
examples/server_node_efd/shared/common.h
lib/librte_eal/common/eal_common_options.c
lib/librte_eal/common/eal_filesystem.h
lib/librte_eal/common/malloc_heap.c