mirror of https://github.com/ArduPilot/ardupilot
HAL_SITL: ensure that unique id string end in null char
This commit is contained in:
parent
c4fa6fee9a
commit
9d7022514e
|
@ -39,6 +39,11 @@ bool HALSITL::Util::get_system_id_unformatted(uint8_t buf[], uint8_t &len)
|
|||
if (ret <= 0) {
|
||||
continue;
|
||||
}
|
||||
if (ret == len) {
|
||||
cbuf[len-1] = '\0';
|
||||
} else {
|
||||
cbuf[ret] = '\0';
|
||||
}
|
||||
len = ret;
|
||||
char *p = strchr(cbuf, '\n');
|
||||
if (p) {
|
||||
|
|
Loading…
Reference in New Issue