mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-24 09:38:29 -04:00
Copter: send_text_P bug fix for short messages
This commit is contained in:
parent
31e3f32930
commit
d10e3bc75f
@ -1071,6 +1071,9 @@ GCS_MAVLINK::send_text_P(gcs_severity severity, const prog_char_t *str)
|
|||||||
uint8_t i;
|
uint8_t i;
|
||||||
for (i=0; i<sizeof(m.text); i++) {
|
for (i=0; i<sizeof(m.text); i++) {
|
||||||
m.text[i] = pgm_read_byte((const prog_char *)(str++));
|
m.text[i] = pgm_read_byte((const prog_char *)(str++));
|
||||||
|
if (m.text[i] == '\0') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (i < sizeof(m.text)) m.text[i] = 0;
|
if (i < sizeof(m.text)) m.text[i] = 0;
|
||||||
mavlink_send_text(chan, severity, (const char *)m.text);
|
mavlink_send_text(chan, severity, (const char *)m.text);
|
||||||
|
Loading…
Reference in New Issue
Block a user