Skip to content

Conversation

@pabigot
Copy link
Contributor

@pabigot pabigot commented Dec 11, 2020

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.

@pabigot pabigot requested a review from npitre December 11, 2020 19:53
@github-actions github-actions bot added the area: Tests Issues related to a particular existing or missing test label Dec 11, 2020
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: Peter Bigot <peter.bigot@nordicsemi.no>
@nashif nashif merged commit 5376223 into zephyrproject-rtos:master Dec 18, 2020
@pabigot pabigot deleted the nordic/20201211c branch January 11, 2021 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Tests Issues related to a particular existing or missing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants