From 9836b7c549feaaeb6c5603d4d1310f5b331f9c80 Mon Sep 17 00:00:00 2001 From: murata Date: Sun, 12 Mar 2023 12:26:41 +0900 Subject: [PATCH] AP_Notify: Use the number of arrays --- libraries/AP_Notify/AP_Notify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Notify/AP_Notify.cpp b/libraries/AP_Notify/AP_Notify.cpp index c1092d1161..80103df723 100644 --- a/libraries/AP_Notify/AP_Notify.cpp +++ b/libraries/AP_Notify/AP_Notify.cpp @@ -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; }