mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 09:08:30 -04:00
AP_InertialSensor: avoid integer underflow in mavlink txspace check
This commit is contained in:
parent
1aeac23f46
commit
f7b01a6f3f
@ -39,7 +39,7 @@ void AP_InertialSensor_UserInteract_MAVLink::_printf_P(const prog_char* fmt, ...
|
||||
// STATUSTEXT messages should not add linefeed
|
||||
msg[strlen(msg)-1] = 0;
|
||||
}
|
||||
while (comm_get_txspace(_chan) - MAVLINK_NUM_NON_PAYLOAD_BYTES < (int)sizeof(mavlink_statustext_t)) {
|
||||
while (comm_get_txspace(_chan) < MAVLINK_NUM_NON_PAYLOAD_BYTES + (int)sizeof(mavlink_statustext_t)) {
|
||||
hal.scheduler->delay(1);
|
||||
}
|
||||
mavlink_msg_statustext_send(_chan, SEVERITY_USER_RESPONSE, msg);
|
||||
|
Loading…
Reference in New Issue
Block a user