From 9923bd1fd25d14a66fee83837d4f548e92ea2e83 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 6 Sep 2018 13:30:32 +1000 Subject: [PATCH] AP_BattMonitor: use sizeof(array) in place of constant --- libraries/AP_BattMonitor/AP_BattMonitor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_BattMonitor/AP_BattMonitor.cpp b/libraries/AP_BattMonitor/AP_BattMonitor.cpp index 2e3812e17c..5d6f91c88c 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor.cpp +++ b/libraries/AP_BattMonitor/AP_BattMonitor.cpp @@ -209,9 +209,9 @@ void AP_BattMonitor::convert_params(void) { info.old_group_element = conversionTable[i].old_element; info.type = (ap_var_type)AP_BattMonitor_Params::var_info[destination_index].type; if (param_instance) { - hal.util->snprintf(param_name, 17, "BATT2_%s", AP_BattMonitor_Params::var_info[destination_index].name); + hal.util->snprintf(param_name, sizeof(param_name), "BATT2_%s", AP_BattMonitor_Params::var_info[destination_index].name); } else { - hal.util->snprintf(param_name, 17, "BATT_%s", AP_BattMonitor_Params::var_info[destination_index].name); + hal.util->snprintf(param_name, sizeof(param_name), "BATT_%s", AP_BattMonitor_Params::var_info[destination_index].name); } AP_Param::convert_old_parameter(&info, 1.0f, 0);