Fix potential string overflow corner case

This commit is contained in:
Lorenz Meier
2016-04-22 09:36:07 +02:00
parent b046f93173
commit 851b5d02a9
@@ -452,8 +452,8 @@ calibrate_return calibrate_from_orientation(orb_advert_t *mavlink_log_pub,
for (unsigned int cur_orientation=0; cur_orientation<detect_orientation_side_count; cur_orientation++) {
if (!side_data_collected[cur_orientation]) {
strncat(pendingStr, " ", sizeof(pendingStr));
strncat(pendingStr, detect_orientation_str((enum detect_orientation_return)cur_orientation), sizeof(pendingStr));
strncat(pendingStr, " ", sizeof(pendingStr) - 1);
strncat(pendingStr, detect_orientation_str((enum detect_orientation_return)cur_orientation), sizeof(pendingStr) - 1);
}
}
calibration_log_info(mavlink_log_pub, "[cal] pending:%s", pendingStr);