feat: add precision for strings in printfAdapter#1141
feat: add precision for strings in printfAdapter#1141heinwessels (heinwessels-philips) wants to merge 12 commits intomainfrom
Conversation
|
Thanks for your first PR. We really appreciate it! |
Dependency ReviewThe following issues were found:
Snapshot WarningsConsider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. License Issuesexternal/args/CMakeLists.txt
cmake/emil_test_helpers.cmake
lwip/lwip/CMakeLists.txt
infra/syntax/CMakeLists.txt
external/crypto/micro-ecc/CMakeLists.txt
external/crypto/mbedtls/CMakeLists.txt
external/crypto/tiny-aes128/CMakeLists.txt
osal/threadx/CMakeLists.txt
external/segger_rtt/CMakeLists.txt
osal/freertos/CMakeLists.txt
external/protobuf/CMakeLists.txt
OpenSSF ScorecardScorecard details
Scanned Files
|
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 12 | 0 | 0 | 0.08s | |
| ✅ CPP | clang-format | 1062 | 9 | 0 | 0 | 10.86s |
| ✅ DOCKERFILE | hadolint | 2 | 0 | 0 | 0.05s | |
| ✅ JSON | jsonlint | 7 | 0 | 0 | 0.54s | |
| ✅ JSON | prettier | 7 | 0 | 0 | 0 | 0.66s |
| markdownlint | 6 | 0 | 4 | 0 | 1.43s | |
| ✅ MARKDOWN | markdown-table-formatter | 6 | 0 | 0 | 0 | 0.32s |
| ✅ REPOSITORY | checkov | yes | no | no | 32.11s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.02s | |
| ✅ REPOSITORY | grype | yes | no | no | 44.92s | |
| ✅ REPOSITORY | ls-lint | yes | no | no | 0.1s | |
| ✅ REPOSITORY | secretlint | yes | no | no | 16.52s | |
| ✅ REPOSITORY | syft | yes | no | no | 1.65s | |
| ✅ REPOSITORY | trivy | yes | no | no | 20.84s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.58s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 12.54s | |
| lychee | 139 | 214 | 0 | 21.12s | ||
| prettier | 22 | 1 | 1 | 0 | 1.01s | |
| ✅ YAML | v8r | 22 | 0 | 0 | 9.66s | |
| ✅ YAML | yamllint | 22 | 0 | 0 | 0.97s |
Detailed Issues
⚠️ SPELL / lychee - 214 errors
-infra-lib/issues/688 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/165 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/848 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/803 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/129 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/823 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/406 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/665 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/870 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/667 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1078 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/961 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/549 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/594 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/338 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/460 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1064 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/441 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/336 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1104 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/294 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1045 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/134 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/826 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/721 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/658 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/177 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/600 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1126 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/compare/v8.0.0...v9.0.0 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/311 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/984 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/536 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/911 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/940 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/225 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1058 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/886 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/compare/v3.2.0...v4.0.0 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/872 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/514 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/744 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/457 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/502 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/951 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/659 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1057 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/compare/v7.0.0...v7.1.0 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/602 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/784 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/760 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/832 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1089 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/798 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/compare/v3.1.0...v3.2.0 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/844 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/871 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/compare/v6.1.0...v7.0.0 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1061 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/521 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1091 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/909 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/1087 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/issues/404 | Network error: Too Many Requests
[429] https://github.com/philips-software/amp-embedded-infra-lib/commit/HIDDEN_BY_MEGALINTER| Network error: Too Many Requests
Errors in infra/syntax/CMakeLists.txt
[429] https://github.com/zeux/pugixml | Network error: Too Many Requests
(Truncated to last 13333 characters out of 50796)
⚠️ MARKDOWN / markdownlint - 4 errors
external/crypto/tiny-aes128/README.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "### Tiny AES128 in C"]
external/crypto/tiny-aes128/README.md:29 error MD046/code-block-style Code block style [Expected: fenced; Actual: indented]
external/crypto/tiny-aes128/README.md:39 error MD046/code-block-style Code block style [Expected: fenced; Actual: indented]
external/crypto/tiny-aes128/README.md:49 error MD046/code-block-style Code block style [Expected: fenced; Actual: indented]
⚠️ YAML / prettier - 1 error
[error] Explicitly specified pattern "documents/modules/ROOT/examples/clangformat.yaml" is a symbolic link.
.clusterfuzzlite/project.yaml 42ms (unchanged)
.github/dependabot.yml 24ms (unchanged)
.github/workflows/ci.yml 123ms (unchanged)
.github/workflows/dependency-scanner.yml 21ms (unchanged)
.github/workflows/documentation.yml 19ms (unchanged)
.github/workflows/fuzzing-batch.yml 7ms (unchanged)
.github/workflows/fuzzing-cron.yml 7ms (unchanged)
.github/workflows/fuzzing-pr.yml 6ms (unchanged)
.github/workflows/linting-formatting.yml 21ms (unchanged)
.github/workflows/release-please.yml 23ms (unchanged)
.github/workflows/security.yml 12ms (unchanged)
.github/workflows/social-interaction.yml 6ms (unchanged)
.github/workflows/static-analysis.yml 12ms (unchanged)
.github/workflows/validate-pr.yml 22ms (unchanged)
.ls-lint.yml 2ms
.mega-linter.yml 3ms (unchanged)
antora-playbook-branch.yml 3ms (unchanged)
antora-playbook-site.yml 8ms (unchanged)
documents/antora.yml 3ms (unchanged)
documents/supplemental-ui/ui.yml 1ms (unchanged)
mull.yml 2ms (unchanged)
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.4.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GRYPE,REPOSITORY_LS_LINT,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

Show us your support by starring ⭐ the repository
There was a problem hiding this comment.
Pull request overview
Adds precision parsing to TracerAdapterPrintf so %.*s/%.Ns can safely print bounded/non-null-terminated string data, and fixes width parsing when the width includes 0 digits.
Changes:
- Parse and forward
precisionfrom the format string (.*and.N). - Implement precision-limited output for
%s. - Fix width parsing so widths like
%10xare interpreted correctly, and extend tests accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| services/tracer/TracerAdapterPrintf.hpp | Extends the adapter interface to parse and pass precision into formatting. |
| services/tracer/TracerAdapterPrintf.cpp | Implements precision parsing and %s precision handling; adjusts width parsing behavior. |
| services/tracer/test/TestTracerAdapterPrintf.cpp | Adds coverage for width-with-0 parsing and %s precision cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR extends services::TracerAdapterPrintf with support for precision when formatting strings (%s), primarily to safely log non-null-terminated string buffers (e.g. bounded strings). It also corrects width parsing when the width contains a 0 digit (e.g. %10x previously being misread).
Changes:
- Add parsing for printf-style
precision(static and dynamic via*) and apply it to%s. - Fix width parsing to correctly handle widths containing
0digits. - Expand unit tests to cover the new precision behavior, the width parsing fix, and trailing-
%safety.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| services/tracer/TracerAdapterPrintf.hpp | Extends the internal parsing API to pass precision through to format handling. |
| services/tracer/TracerAdapterPrintf.cpp | Implements precision parsing, applies it for %s, and adjusts the main loop to avoid reading past \\0 on trailing %. |
| services/tracer/test/TestTracerAdapterPrintf.cpp | Adds coverage for string precision (static/dynamic/zero/null) and for the width-with-zero fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
There was a problem hiding this comment.
Pull request overview
This PR enhances services::TracerAdapterPrintf to support precision for %s (including dynamic * precision) so bounded/non-null-terminated strings can be logged safely. It also fixes format parsing edge cases around width parsing and trailing %.
Changes:
- Added precision parsing (
ReadPrecision) and threaded precision throughHandleFormat→ParseFormat. - Fixed width parsing when the width contains
0digits (e.g.%10x) and made trailing%stop safely at end-of-string. - Expanded tracer printf adapter unit tests to cover the new precision behavior, width parsing, and trailing
%cases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| services/tracer/TracerAdapterPrintf.cpp | Implements precision parsing/handling, fixes width parsing, and adds safe handling for trailing %. |
| services/tracer/TracerAdapterPrintf.hpp | Updates private API to pass precision through format parsing. |
| services/tracer/test/TestTracerAdapterPrintf.cpp | Adds tests for string precision, width-with-zero parsing, and trailing % edge cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR extends services::TracerAdapterPrintf with support for precision when printing strings (%.*s / %.Ns), primarily to safely log non-null-terminated bounded strings, and also hardens parsing around width-with-zeros and trailing %.
Changes:
- Add precision parsing (
.+ digits or*) and apply it to%sby emitting aninfra::BoundedConstStringwith bounded length. - Fix width parsing when the width contains
0digits (e.g.%10x) and add coverage for wider hex formats (e.g.%016llx). - Prevent out-of-bounds reads when the format string ends with a trailing
%, and add regression tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| services/tracer/TracerAdapterPrintf.cpp | Implements precision parsing and bounded %s output; adds guard for trailing %; fixes width digit parsing. |
| services/tracer/TracerAdapterPrintf.hpp | Updates the internal parsing API to thread precision through to ParseFormat. |
| services/tracer/test/TestTracerAdapterPrintf.cpp | Adds tests for width-with-zeros, long-long hex width, string precision behavior, and trailing % handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| TEST_F(TracerAdapterPrintfTest, print_null_string_with_precision) | ||
| { | ||
| Print("%.*s", 5, nullptr); |



This allows printing a string with
precision, meaning specifying the amount of characters to print. This is because we use mainlyBondedStringto store strings, which is not guaranteed to be null-terminated. So in order to not print garbage you can now do:This might be used for
LOG_AND_ABORT, or where for some platforms where internal HAL layer's logs are forwarded to the tracer through this PrintfAdapterIt also fixes a bug if the
widthcontained leading zeros, and if there was a trailing%for some reason.Note: precision can also be used for other formats, but for now that's seen as out-of-scope.
An explanation of
precision(from here):