Skip to content
Commit 686f60f5 authored by Darwin Rambo's avatar Darwin Rambo Committed by Tom Rini
Browse files

lib: fix return codes when CONFIG_SYS_VSNPRINTF is enabled



When CONFIG_SYS_VSNPRINTF is enabled, it protects print operations
such as sprintf, snprintf, vsnprintf, etc., from buffer overflows.
But vsnprintf_internal includes the terminating NULL character in
the calculation of number of characters written. This affects sprintf
and snprintf return values. Fix this issue by setting pointer 'str'
back to the location of the '\0'.

Signed-off-by: default avatarDarwin Rambo <drambo@broadcom.com>
Reviewed-by: default avatarSteve Rae <srae@broadcom.com>
parent de351d6b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment