Skip to content
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

temperature_compensation: use snprintf instead of sprintf #21870

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Jul 20, 2023

Solved Problem

MacOS CI failing with:

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.

Solution

Use snprintf with the buffer limit since it's better practise and hopefully will fix MacOS CI.

Changelog Entry

Refactor: thermal calibration cstring better practise

Alternatives

There are many more sprintfs mostly in the xrce log functionality (submodule) but apparently that's not compiled by default for SITL.

Test coverage

Builds locally on Ubuntu, let's see what MacOS CI does.

Context

Example failed build: https://github.com/PX4/PX4-Autopilot/actions/runs/5602138930/jobs/10246984717

because sprintf is deprecated on MacOS
and CI fails with warning -> error:

'sprintf' is deprecated: This function is
provided for compatibility reasons only.
Due to security concerns inherent in the
design of sprintf(3), it is highly
recommended that you use snprintf(3) instead.
@MaEtUgR MaEtUgR requested a review from mcsauder July 20, 2023 08:31
@MaEtUgR MaEtUgR self-assigned this Jul 20, 2023
@MaEtUgR
Copy link
Member Author

MaEtUgR commented Jul 20, 2023

image
image
👍

@MaEtUgR MaEtUgR merged commit 6889443 into main Jul 20, 2023
85 of 86 checks passed
@MaEtUgR MaEtUgR deleted the maetugr/macos-ci-fix branch July 20, 2023 11:18
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.

None yet

1 participant