mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 04:53:35 +08:00
IridiumSBD: use strncpy instead of strcpy
This commit is contained in:
@@ -135,7 +135,8 @@ void IridiumSBD::test(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (argc > 2) {
|
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 {
|
} else {
|
||||||
instance->test_command[0] = 0;
|
instance->test_command[0] = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user