Skip to content
Commit 53762239 authored by Peter Bigot's avatar Peter Bigot Committed by Anas Nashif
Browse files

lib: cbprintf: fix mishandling of precision string output



If a precision flag is included for s formatting that bounds the
maximum output length, so we need to use strnlen rather than strlen to
get the amount of data to emit.  With that flag we can't expect there
to be a terminating NUL following the text to print.

Also fix handling of an empty precision, which should behave as if a
precision of zero was provided.

Signed-off-by: default avatarPeter Bigot <peter.bigot@nordicsemi.no>
parent 5be8afcf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment