mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
temperature_compensation: use snprintf instead of sprintf
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.
This commit is contained in:
parent
a37e3e7b06
commit
6889443bd7
@ -212,7 +212,7 @@ int TemperatureCalibrationMag::finish_sensor_instance(PerSensorData &data, int s
|
||||
|
||||
for (unsigned axis_index = 0; axis_index < 3; axis_index++) {
|
||||
for (unsigned coef_index = 0; coef_index <= 3; coef_index++) {
|
||||
sprintf(str, "TC_M%d_X%d_%d", sensor_index, 3 - coef_index, axis_index);
|
||||
snprintf(str, sizeof(str), "TC_M%d_X%d_%d", sensor_index, 3 - coef_index, axis_index);
|
||||
param = (float)res[axis_index][coef_index];
|
||||
result = param_set_no_notification(param_find(str), ¶m);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user