AP_Proximity: fix possible overflow/truncation issue

This commit is contained in:
Holger Steinhaus 2018-03-16 21:02:30 +01:00
parent 5282ed3a1b
commit 5af02dde59

View File

@ -285,7 +285,7 @@ bool AP_Proximity_LightWareSF40C::send_request_for_distance()
} }
// prepare request // prepare request
char request_str[15]; char request_str[16];
snprintf(request_str, sizeof(request_str), "?TS,%d,%d\r\n", (int)(_sector_width_deg[_last_sector]), (int)(_sector_middle_deg[_last_sector])); snprintf(request_str, sizeof(request_str), "?TS,%d,%d\r\n", (int)(_sector_width_deg[_last_sector]), (int)(_sector_middle_deg[_last_sector]));
uart->write(request_str); uart->write(request_str);