mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
IridiumSBD: use strncpy instead of strcpy
This commit is contained in:
parent
9be11c048a
commit
ecb0dc2bc4
@ -135,7 +135,8 @@ void IridiumSBD::test(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
strcpy(instance->test_command, argv[2]);
|
||||
strncpy(instance->test_command, argv[2], sizeof(instance->test_command));
|
||||
instance->test_command[sizeof(instance->test_command) - 1] = 0;
|
||||
|
||||
} else {
|
||||
instance->test_command[0] = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user