Skip to content

feat: add precision for strings in printfAdapter#1141

Open
heinwessels (heinwessels-philips) wants to merge 12 commits intomainfrom
feature/printf-adapter-specify-number-chars-of-string
Open

feat: add precision for strings in printfAdapter#1141
heinwessels (heinwessels-philips) wants to merge 12 commits intomainfrom
feature/printf-adapter-specify-number-chars-of-string

Conversation

@heinwessels-philips
Copy link
Contributor

@heinwessels-philips heinwessels (heinwessels-philips) commented Mar 18, 2026

This allows printing a string with precision, meaning specifying the amount of characters to print. This is because we use mainly BondedString to store strings, which is not guaranteed to be null-terminated. So in order to not print garbage you can now do:

infra::BoundedConstString::WithStorage<4> str ("abcd");
Print("%.*s", str.length(), str.data());

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 PrintfAdapter

It also fixes a bug if the width contained 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):

An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] [Option Start] and S [Option End] conversion specifiers. The precision takes the form of a ( '.' ) followed either by an ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.

@github-actions
Copy link
Contributor

Thanks for your first PR. We really appreciate it!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 33 package(s) with unknown licenses.
See the Details below.

Snapshot Warnings

⚠️: The number of snapshots compared for the base SHA (0) and the head SHA (1) do not match. You may see unexpected additions in the diff.
Consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

License Issues

external/args/CMakeLists.txt

PackageVersionLicenseIssue Type
taywee/args114200a9ad5fe06c8dea76e15d92325695cf3e34NullUnknown License
taywee/args114200a9ad5fe06c8dea76e15d92325695cf3e34NullUnknown License
taywee/args114200a9ad5fe06c8dea76e15d92325695cf3e34NullUnknown License

cmake/emil_test_helpers.cmake

PackageVersionLicenseIssue Type
google/googletestv1.14.0NullUnknown License
google/googletestv1.14.0NullUnknown License
google/googletestv1.14.0NullUnknown License

lwip/lwip/CMakeLists.txt

PackageVersionLicenseIssue Type
lwip-tcpip/lwip77dcd25a72509eb83f72b033d219b1d40cd8eb95NullUnknown License
lwip-tcpip/lwip77dcd25a72509eb83f72b033d219b1d40cd8eb95NullUnknown License
lwip-tcpip/lwip77dcd25a72509eb83f72b033d219b1d40cd8eb95NullUnknown License

infra/syntax/CMakeLists.txt

PackageVersionLicenseIssue Type
zeux/pugixmlef856bf975f4b1909af1b40ed3d7e28af9263d95NullUnknown License
zeux/pugixmlef856bf975f4b1909af1b40ed3d7e28af9263d95NullUnknown License
zeux/pugixmlef856bf975f4b1909af1b40ed3d7e28af9263d95NullUnknown License

external/crypto/micro-ecc/CMakeLists.txt

PackageVersionLicenseIssue Type
kmackay/micro-ecc24c60e243580c7868f4334a1ba3123481fe1aa48NullUnknown License
kmackay/micro-ecc24c60e243580c7868f4334a1ba3123481fe1aa48NullUnknown License
kmackay/micro-ecc24c60e243580c7868f4334a1ba3123481fe1aa48NullUnknown License

external/crypto/mbedtls/CMakeLists.txt

PackageVersionLicenseIssue Type
mbed-tls/mbedtls107ea89daaefb9867ea9121002fbbdf926780e98NullUnknown License
mbed-tls/mbedtls107ea89daaefb9867ea9121002fbbdf926780e98NullUnknown License
mbed-tls/mbedtls107ea89daaefb9867ea9121002fbbdf926780e98NullUnknown License

external/crypto/tiny-aes128/CMakeLists.txt

PackageVersionLicenseIssue Type
kokke/tiny-aes-c7e42e693288bdf22d8e677da94248115168211b9NullUnknown License
kokke/tiny-aes-c7e42e693288bdf22d8e677da94248115168211b9NullUnknown License
kokke/tiny-aes-c7e42e693288bdf22d8e677da94248115168211b9NullUnknown License

osal/threadx/CMakeLists.txt

PackageVersionLicenseIssue Type
eclipse-threadx/threadx06dabb0ad0403f59889ce85eeb3d48dbd9d3759bNullUnknown License
eclipse-threadx/threadx06dabb0ad0403f59889ce85eeb3d48dbd9d3759bNullUnknown License
eclipse-threadx/threadx06dabb0ad0403f59889ce85eeb3d48dbd9d3759bNullUnknown License

external/segger_rtt/CMakeLists.txt

PackageVersionLicenseIssue Type
seggermicro/rttff57c3d516ea59b0a2d4d5cafb33a48572b09c0bNullUnknown License
seggermicro/rttff57c3d516ea59b0a2d4d5cafb33a48572b09c0bNullUnknown License
seggermicro/rttff57c3d516ea59b0a2d4d5cafb33a48572b09c0bNullUnknown License

osal/freertos/CMakeLists.txt

PackageVersionLicenseIssue Type
freertos/freertos-kerneldef7d2df2b0506d3d249334974f51e427c17a41cNullUnknown License
freertos/freertos-kerneldef7d2df2b0506d3d249334974f51e427c17a41cNullUnknown License
freertos/freertos-kerneldef7d2df2b0506d3d249334974f51e427c17a41cNullUnknown License

external/protobuf/CMakeLists.txt

PackageVersionLicenseIssue Type
protocolbuffers/protobufedaa823d8b36a8656d7b2b9241b7d0bfe50af878NullUnknown License
protocolbuffers/protobufedaa823d8b36a8656d7b2b9241b7d0bfe50af878NullUnknown License
protocolbuffers/protobufedaa823d8b36a8656d7b2b9241b7d0bfe50af878NullUnknown License

OpenSSF Scorecard

Scorecard details
PackageVersionScoreDetails
unknown/taywee/args 114200a9ad5fe06c8dea76e15d92325695cf3e34 UnknownUnknown
unknown/google/googletest v1.14.0 UnknownUnknown
unknown/lwip-tcpip/lwip 77dcd25a72509eb83f72b033d219b1d40cd8eb95 UnknownUnknown
unknown/zeux/pugixml ef856bf975f4b1909af1b40ed3d7e28af9263d95 UnknownUnknown
unknown/kmackay/micro-ecc 24c60e243580c7868f4334a1ba3123481fe1aa48 UnknownUnknown
unknown/mbed-tls/mbedtls 107ea89daaefb9867ea9121002fbbdf926780e98 UnknownUnknown
unknown/kokke/tiny-aes-c 7e42e693288bdf22d8e677da94248115168211b9 UnknownUnknown
unknown/eclipse-threadx/threadx 06dabb0ad0403f59889ce85eeb3d48dbd9d3759b UnknownUnknown
unknown/seggermicro/rtt ff57c3d516ea59b0a2d4d5cafb33a48572b09c0b UnknownUnknown
unknown/freertos/freertos-kernel def7d2df2b0506d3d249334974f51e427c17a41c UnknownUnknown
unknown/protocolbuffers/protobuf edaa823d8b36a8656d7b2b9241b7d0bfe50af878 UnknownUnknown
unknown/kmackay/micro-ecc 24c60e243580c7868f4334a1ba3123481fe1aa48 UnknownUnknown
unknown/freertos/freertos-kernel def7d2df2b0506d3d249334974f51e427c17a41c UnknownUnknown
unknown/seggermicro/rtt ff57c3d516ea59b0a2d4d5cafb33a48572b09c0b UnknownUnknown
unknown/zeux/pugixml ef856bf975f4b1909af1b40ed3d7e28af9263d95 UnknownUnknown
unknown/taywee/args 114200a9ad5fe06c8dea76e15d92325695cf3e34 UnknownUnknown
unknown/kokke/tiny-aes-c 7e42e693288bdf22d8e677da94248115168211b9 UnknownUnknown
unknown/mbed-tls/mbedtls 107ea89daaefb9867ea9121002fbbdf926780e98 UnknownUnknown
unknown/eclipse-threadx/threadx 06dabb0ad0403f59889ce85eeb3d48dbd9d3759b UnknownUnknown
unknown/protocolbuffers/protobuf edaa823d8b36a8656d7b2b9241b7d0bfe50af878 UnknownUnknown
unknown/lwip-tcpip/lwip 77dcd25a72509eb83f72b033d219b1d40cd8eb95 UnknownUnknown
unknown/google/googletest v1.14.0 UnknownUnknown
unknown/seggermicro/rtt ff57c3d516ea59b0a2d4d5cafb33a48572b09c0b UnknownUnknown
unknown/zeux/pugixml ef856bf975f4b1909af1b40ed3d7e28af9263d95 UnknownUnknown
unknown/kmackay/micro-ecc 24c60e243580c7868f4334a1ba3123481fe1aa48 UnknownUnknown
unknown/lwip-tcpip/lwip 77dcd25a72509eb83f72b033d219b1d40cd8eb95 UnknownUnknown
unknown/mbed-tls/mbedtls 107ea89daaefb9867ea9121002fbbdf926780e98 UnknownUnknown
unknown/protocolbuffers/protobuf edaa823d8b36a8656d7b2b9241b7d0bfe50af878 UnknownUnknown
unknown/kokke/tiny-aes-c 7e42e693288bdf22d8e677da94248115168211b9 UnknownUnknown
unknown/freertos/freertos-kernel def7d2df2b0506d3d249334974f51e427c17a41c UnknownUnknown
unknown/google/googletest v1.14.0 UnknownUnknown
unknown/taywee/args 114200a9ad5fe06c8dea76e15d92325695cf3e34 UnknownUnknown
unknown/eclipse-threadx/threadx 06dabb0ad0403f59889ce85eeb3d48dbd9d3759b UnknownUnknown

Scanned Files

  • cmake/emil_test_helpers.cmake
  • external/args/CMakeLists.txt
  • external/crypto/mbedtls/CMakeLists.txt
  • external/crypto/micro-ecc/CMakeLists.txt
  • external/crypto/tiny-aes128/CMakeLists.txt
  • external/protobuf/CMakeLists.txt
  • external/segger_rtt/CMakeLists.txt
  • infra/syntax/CMakeLists.txt
  • lwip/lwip/CMakeLists.txt
  • osal/freertos/CMakeLists.txt
  • osal/threadx/CMakeLists.txt

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

⚠️MegaLinter analysis: Success with warnings

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
⚠️ MARKDOWN 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
⚠️ SPELL lychee 139 214 0 21.12s
⚠️ YAML 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

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 precision from the format string (.* and .N).
  • Implement precision-limited output for %s.
  • Fix width parsing so widths like %10x are 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 0 digits.
  • 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.

@heinwessels-philips heinwessels (heinwessels-philips) marked this pull request as draft March 18, 2026 13:56
@sonarqubecloud
Copy link

@heinwessels-philips heinwessels (heinwessels-philips) marked this pull request as ready for review March 18, 2026 15:00
Copilot AI review requested due to automatic review settings March 18, 2026 15:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 through HandleFormatParseFormat.
  • Fixed width parsing when the width contains 0 digits (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.

@heinwessels-philips heinwessels (heinwessels-philips) marked this pull request as draft March 18, 2026 15:05
@heinwessels-philips heinwessels (heinwessels-philips) marked this pull request as ready for review March 18, 2026 19:11
Copilot AI review requested due to automatic review settings March 18, 2026 19:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 %s by emitting an infra::BoundedConstString with bounded length.
  • Fix width parsing when the width contains 0 digits (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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants