AP_Notify: Use the number of arrays

This commit is contained in:
murata 2023-03-12 12:26:41 +09:00 committed by Tom Pittenger
parent 052114541a
commit 9836b7c549

View File

@ -473,7 +473,7 @@ void AP_Notify::play_tune(const char *tune)
// set flight mode string
void AP_Notify::set_flight_mode_str(const char *str)
{
strncpy(_flight_mode_str, str, 4);
strncpy(_flight_mode_str, str, sizeof(_flight_mode_str));
_flight_mode_str[sizeof(_flight_mode_str)-1] = 0;
}