mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 01:33:34 +08:00
Fix -Werror=format-truncation on GCC 7
Fix formatting Check snprintf return for error AND overflow
This commit is contained in:
committed by
Julian Oes
parent
407b403e68
commit
7929287f73
@@ -684,7 +684,8 @@ GPS::task_main()
|
||||
switch (_mode) {
|
||||
case GPS_DRIVER_MODE_NONE:
|
||||
_mode = GPS_DRIVER_MODE_UBX;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case GPS_DRIVER_MODE_UBX:
|
||||
_helper = new GPSDriverUBX(_interface, &GPS::callback, this, &_report_gps_pos, _p_report_sat_info);
|
||||
|
||||
@@ -718,7 +718,8 @@ PWMSim::pwm_ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case PWM_SERVO_SET(0):
|
||||
case PWM_SERVO_SET(1):
|
||||
@@ -740,7 +741,8 @@ PWMSim::pwm_ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case PWM_SERVO_GET(3):
|
||||
case PWM_SERVO_GET(2):
|
||||
@@ -748,8 +750,9 @@ PWMSim::pwm_ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case PWM_SERVO_GET(1):
|
||||
case PWM_SERVO_GET(0): {
|
||||
*(servo_position_t *)arg = 1500;
|
||||
|
||||
@@ -231,7 +231,8 @@ int InputMavlinkCmdMount::update_impl(unsigned int timeout_ms, ControlData **con
|
||||
switch ((int)vehicle_command.param7) {
|
||||
case vehicle_command_s::VEHICLE_MOUNT_MODE_RETRACT:
|
||||
_control_data.gimbal_shutter_retract = true;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case vehicle_command_s::VEHICLE_MOUNT_MODE_NEUTRAL:
|
||||
_control_data.type = ControlData::Type::Neutral;
|
||||
|
||||
Reference in New Issue
Block a user