Mixer test: Condition strncpy properly

This commit is contained in:
Lorenz Meier
2017-01-02 16:50:18 +01:00
committed by Daniel Agar
parent 9e95d88574
commit 3229c4183a
+1 -1
View File
@@ -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);