[dpdk-dev] [PATCH] Fix off-by-one errors in snprintf in various files

Burakov, Anatoly anatoly.burakov at intel.com
Fri May 10 17:28:46 CEST 2019

On 10-May-19 3:53 PM, Michael Santana wrote:
> 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 at dpdk.org
> Signed-off-by: Michael Santana <msantana at redhat.com>
> ---


Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>


More information about the dev mailing list