mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 01:04:19 +08:00
Mixer test: Condition strncpy properly
This commit is contained in:
committed by
Daniel Agar
parent
9e95d88574
commit
3229c4183a
@@ -217,7 +217,7 @@ bool MixerTest::loadAllTest()
|
||||
|
||||
char buf[PATH_MAX];
|
||||
(void)strncpy(&buf[0], MIXER_ONBOARD_PATH, sizeof(buf));
|
||||
(void)strncpy(&buf[strlen(MIXER_ONBOARD_PATH)], result->d_name, sizeof(buf));
|
||||
(void)strncpy(&buf[strlen(MIXER_ONBOARD_PATH)], result->d_name, sizeof(buf) - strlen(MIXER_ONBOARD_PATH));
|
||||
|
||||
bool ret = load_mixer(buf, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user