Copter: send_text_P bug fix for short messages

This commit is contained in:
Randy Mackay 2013-05-20 12:52:20 +09:00
parent 31e3f32930
commit d10e3bc75f

View File

@ -1071,6 +1071,9 @@ GCS_MAVLINK::send_text_P(gcs_severity severity, const prog_char_t *str)
uint8_t i;
for (i=0; i<sizeof(m.text); i++) {
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;
mavlink_send_text(chan, severity, (const char *)m.text);