-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix snprintf in minimal-printf library #12632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@evedon, thank you for your changes. |
This fixes the issue as confirmed in #12620 (comment) I'll review shortly, first going to close reopen to restart Travis working |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As soon as commit msg is updated, LGTM. We can start CI
42703d8
to
3389b0f
Compare
Done |
mbed_minimal_putchar assumed that buffer being NULL meant that it should print to a file. This caused a system crash when calling snprintf with both buffer and stream set to NULL. It is valid to call snprintf with a NULL buffer; nothing should be outputted, but the string length should be measured.
mbed_minimal_formatted_string_character is no longer required since fputc does the new line conversion. This results in a small Flash saving.
3389b0f
to
a3c3656
Compare
CI started |
Test run: FAILEDSummary: 1 of 6 test jobs failed Failed test jobs:
|
Test restarted. This should get in today |
Disco target fails few test cases for devicekey, I restarted it to make sure it's there. Please review failures |
test_direct_access_to_devicekey_tdb_flashiap_default fails. @SeppoTakalo can you help? |
The test fail in:
Where This sounds like a broken hardware.. Reading a flash should not easily fail. |
Also PR #12683 , similar failure. Will talk to @ARMmbed/mbed-os-test to check the board |
@0xc0170 |
Tests restarted |
Tests passed 🎉 |
This PR does not contain release version label after merging. |
Summary of changes
mbed_minimal_putchar
assumed that buffer being NULL meant that it should print to a file. This caused a system crash when calling snprintf with both buffer and stream set to NULL. It is valid to call snprintf with a NULL buffer; nothing should be outputed, but the string length should be measured.Removed
mbed_minimal_formatted_string_character
which is no longer required sincefputc
does the new line conversion. This results in a small Flash saving.Impact of changes
Fixes #12620
Migration actions required
None
Documentation
None
Pull request type
Test results
Reviewers
@kjbracey-arm