mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
rc_input: fix possible string truncation (-Werror=stringop-truncation)
This commit is contained in:
parent
e0ade94d25
commit
6b1e7ffdb8
@ -58,7 +58,7 @@ RCInput::RCInput(const char *device) :
|
||||
}
|
||||
|
||||
if (device) {
|
||||
strncpy(_device, device, sizeof(_device));
|
||||
strncpy(_device, device, sizeof(_device) - 1);
|
||||
_device[sizeof(_device) - 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user