APM_Control: Supress some compilier warnings about strncpy

This commit is contained in:
Michael du Breuil 2018-05-28 13:12:08 -07:00 committed by Francisco Ferreira
parent b2d8f6e788
commit 84b1a6a58b

View File

@ -273,10 +273,10 @@ void AP_AutoTune::log_param_change(float v, const char *suffix)
} }
char key[AP_MAX_NAME_SIZE+1]; char key[AP_MAX_NAME_SIZE+1];
if (type == AUTOTUNE_ROLL) { if (type == AUTOTUNE_ROLL) {
strncpy(key, "RLL2SRV_", 8); strncpy(key, "RLL2SRV_", 9);
strncpy(&key[8], suffix, AP_MAX_NAME_SIZE-8); strncpy(&key[8], suffix, AP_MAX_NAME_SIZE-8);
} else { } else {
strncpy(key, "PTCH2SRV_", 9); strncpy(key, "PTCH2SRV_", 10);
strncpy(&key[9], suffix, AP_MAX_NAME_SIZE-9); strncpy(&key[9], suffix, AP_MAX_NAME_SIZE-9);
} }
key[AP_MAX_NAME_SIZE] = 0; key[AP_MAX_NAME_SIZE] = 0;